Datawise Logo

Docs

API Documentation

Version 1.0.0

DataWise Document Exchange

API v1.0.0

Error Reference

Error Handling

All error responses include a status code, error code, and descriptive message to help you diagnose and resolve issues quickly.

Error Response Format

When an error occurs, the API returns a JSON response with the following structure:

{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error description",
    "details": {
      "field": "fieldName",
      "additionalInfo": "..."
    },
    "correlationId": "a1b2c3d4e5f6",
    "timestamp": "2025-10-08T10:30:00.000Z"
  }
}

Response Headers:
X-Correlation-Id: a1b2c3d4e5f6
Content-Type: application/json

code: Machine-readable error code for programmatic handling

message: Detailed description of the error

details: Additional error-specific information (optional)

correlationId: Unique identifier for tracking this error (12 characters)

timestamp: ISO 8601 timestamp when the error occurred

Error Codes

Error CodeHTTP StatusMessageSolution
AUTH_NO_API_KEY401Unauthorized!! No api key providedInclude the Authorization header with your API key
AUTH_INVALID_API_KEY401Unauthorized!! Invalid api keyVerify your API key is correct and has not been regenerated
AUTH_APP_NOT_ACTIVE403Unauthorized!! App is not activeCheck your application status in the dashboard and ensure it is active

Common Issues & Solutions

Check that ddxE_signPreview is not set to true (preview mode), verify all email addresses are valid, and ensure ddx_outputFormat is set to pdf.
The formData limit is 10MB. For large amounts of images, consider using public or authenticated URLs instead of uploading image files. You can also compress images or reduce document complexity.
Check your application settings in the dashboard, specifically the Charge Amount. If the charge amount is correct, contact support for assistance.

Error Handling Best Practices

Client-Side Handling

try {
  const response = await fetch(url, options);
  const data = await response.json();

  if (!response.ok && data.error) {
    // Save correlation ID for debugging
    const correlationId = data.error.correlationId;
    console.error('Error:', correlationId, data.error.message);

    switch(data.error.code) {
      case 'AUTH_NO_API_KEY':
        // Handle missing API key
        break;
      case 'PAYMENT_INSUFFICIENT_FUNDS':
        // Alert user to add funds
        const { balance, required } = data.error.details;
        break;
      // Add other validation error handling here
      default:
        // Generic error handling with correlation ID
        alert(`Error: ${data.error.message}\nID: ${correlationId}`);
    }
  }
} catch (error) {
  // Network or parsing error
  console.error('Request failed:', error);
}

Retry Logic

async function apiCallWithRetry(
  url, options, maxRetries = 3
) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      const response = await fetch(url, options);

      // Retry on server errors and rate limits
      if (response.status === 429 ||
          response.status === 503 ||
          response.status === 504) {
        if (i < maxRetries - 1) {
          // Wait with exponential backoff before retry
          await new Promise(r =>
            setTimeout(r, 1000 * Math.pow(2, i))
          );
          continue;
        }
        // Last attempt, return error response
        return await response.json();
      }

      return await response.json();
    } catch (error) {
      if (i === maxRetries - 1) throw error;
    }
  }
}

Debugging Tips

1

Save the Correlation ID

Every error includes a unique correlationId. Save this when contacting support to help us quickly locate the exact error in our logs.

2

Validate JSON

Ensure JSON parameters like ddxE_signers and #loops are properly formatted

3

Test with Preview Mode

Use ddxE_signPreview=true to test e-signature flow without sending emails

4

Monitor Dashboard Logs

Check your application logs in the dashboard for detailed error information

5

Use Minimal Test Case

Start with a simple template and gradually add complexity to isolate issues

Need Additional Help?

If you are encountering an error not listed here or need assistance debugging an issue, please contact our support team with the correlation ID from the error response. This unique identifier helps us quickly locate the exact error in our system logs and provide faster assistance.

© Copyright 2026, Datawise Document Exchange.