Standard Response Format
Standard Response Format
To ensure consistency across the platform, all Advanced Dialer APIs utilize a standardized JSON envelope for every response. This structure allows developers to handle successes and errors using a uniform logic pattern.
Response Structure
Every API response contains three root-level properties:
| Field | Type | Description |
|---|---|---|
statusCode | integer | A numeric code indicating the result of the operation. |
message | string | A human-readable description of the result or specific error details. |
payload | vary | The actual data requested (Object, Array, or Null). |
Example Envelope
{
"statusCode": 0,
"message": "Operation completed successfully",
"payload": {
"id": 1001,
"status": "Active"
}
}
Status Codes Reference
The following table defines the specific status codes returned by the Advanced Dialer gateway.
| Code | Status | Description |
|---|---|---|
| 0 | Success | The request was processed successfully. |
| 1 | Warning | The request succeeded, but with non-critical issues. |
| 2 | Error | A general processing error occurred. |
| 3 | Authentication Failed | Invalid or missing API keys/credentials. |
| 4 | Authorization Failed | The authenticated user lacks permission for this resource. |
| 5 | Validation Error | The request body or parameters failed schema validation. |
| 6 | Not Found | The requested resource (Agent, Campaign, etc.) does not exist. |
| 8 | System Error | An internal server error occurred. |
| 9 | Timeout | The request took too long to process. |
| 10 | Rate Limited | Too many requests have been sent in a given timeframe. |
Best Practice
Always check the
statusCodevalue before attempting to parse thepayloadto ensure your application handles errors gracefully.
Troubleshooting Common Errors
When an API request does not return statusCode: 0, refer to this guide to resolve the most common integration hurdles.
🔑 Authentication & Authorization (Codes 3 & 4)
Errors in this category usually relate to your API Key or the specific permissions assigned to that key.
| Code | Status | Common Causes | Recommended Action |
|---|---|---|---|
| 3 | Authentication Failed | Missing or mistyped Ocp-Apim-Subscription-Key. | Verify the key is present in the header and exactly matches your dashboard. |
| 4 | Authorization Failed | The API Key is valid, but doesn't have access to the specific "Product" (e.g., Dialer vs. CRM). | Check your subscription settings to ensure the key is associated with the correct API Product. |
Header Check
Ensure your keys are passed as headers, not as query parameters, unless specifically noted for a legacy endpoint.
🚦 Rate Limiting (Code 10)
To ensure system stability, the Advanced Dialer API enforces rate limits. If you receive Code 10, your application is sending requests too frequently.
Recommended Handling: "Exponential Backoff"
If you encounter a rate limit, do not immediately retry the request. Instead:
- Wait 1 second.
- Retry the request.
- If it fails again, wait 2 seconds, then 4 seconds, and so on.
{
"statusCode": 10,
"message": "Rate limit exceeded. Please try again in 30 seconds.",
"payload": null
}
❌ Validation & Not Found (Codes 5 & 6)
These errors are typically "Client Errors," meaning the request itself needs to be modified.
- Code 5 (Validation Error): Usually occurs during a
POSTorPUT. Check that your JSON body matches the required data types (e.g., sending a string where an integer is expected). - Code 6 (Not Found): Double-check your IDs. For example, if you are querying
/api/agent/1001, ensure that Agent1001actually exists in your specific tenant/prefix.
⚙️ System Errors (Code 8)
If you receive a Code 8, the issue is on the server side.
- Check the [Talkdesk Status Page] to see if there is an active incident.
- If the status is "Green," wait 60 seconds and try once more.
- If the error persists, contact support with the
eventIdif provided in the response message.
Updated about 3 hours ago