Error Handling
EnableX SMS API service uses JSON result codes to indicate whether a method completed successfully. These response codes provide a description of problems that may have occurred with an API call, which can help you in troubleshooting the problems.
Result Code Grouping: The result codes of the SMS API are grouped into the following categories:
Code | Category | Description |
---|---|---|
1xx | Information | The request is received and processed. |
2xx | Success | The request is received and accepted. |
3xx | Redirection | Action is required to complete the request. |
4xx | Client Error | Illegible request syntax. The request cannot be fulfilled. |
5xx | Server Error | The server failed to complete a legitimate request. |
Response Codes: The response codes of the SMS API are grouped into the following categories:
Success Response: Successful API calls always return a JSON with a 0 (zero) result code.
{"result": 0,….….}
Error Response: Unsuccessful API calls return a JSON with a non—zero result code. The error response in the JSON includes 3 keys: result code, error, and description. For example:
{"result": "A non-zero result code.","error": "A brief reason of the error.","desc": "Description of the error/warning."}