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:

CodeCategoryDescription
1xxInformationThe request is received and processed.
2xxSuccessThe request is received and accepted.
3xxRedirectionAction is required to complete the request.
4xxClient ErrorIllegible request syntax. The request cannot be fulfilled.
5xxServer ErrorThe 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."
}