CTRLK

Schema reference and error handling

|

View as Markdown

When using our API, you'll encounter HTTP and API status codes, as well as error codes:

  • HTTP status codes (e.g., 200 OK, 404 Not Found) are standard for every HTTP request.
  • API status codes (e.g. PENDING_ACCEPTED) provide more details on the status of your API request and can be found in the response of sent messages, delivery reports, or message logs.
  • Error codes (e.g. NO_ERROR) can be returned as part of the message response or a delivery report. They provide additional information about issues with your requests (e.g., invalid parameters or internal errors).

HTTP response codes

Infobip tries to return the appropriate status code for every request. Examining the returned status code is the first thing you can do to determine how to react to an API response. Get familiar with the list of all HTTP response codes and their meaning.

Any status in the 200s range (from 200 up to 299) is considered to be successful and no additional reaction is needed.

Responses with a status code in the 400s range (400 to 499) indicate that there was something wrong with your request. Immediately sending the exact same request again will result in the same error. To solve it, analyze the specific status returned and adapt accordingly. If, for example, the status 400 (Bad request) is returned, you should double-check your Content-Type header, check that your request body data is properly serialized, and that the data sent to the API corresponds to the specified request model from the dedicated API endpoint documentation page.

Receiving the status 404 (Not found) means that either the requested API endpoint or the exact resource does not exist. In this case, double-check the API endpoint path defined on the dedicated documentation page.

Status codes in the 500s range (500 to 599) signal that the request is valid but an error occurred on the API side. Depending on the specific status, the error might be temporary, so retrying the same request may yield different results.

json
1{
2 "groupId":3,
3 "groupName":"DELIVERED",
4 "id":5,
5 "name":"DELIVERED_TO_HANDSET",
6 "description":"Message delivered to handset"
7}

Handling Errors

In case of an error, Infobip will attempt to fill the API response with a recognizable and self-explanatory message. In such scenarios, it is advisable to have your code analyze the API response and react to it accordingly. For help with troubleshooting, contact Support.

json
1{
2 "groupId":0,
3 "groupName":"OK",
4 "id":0,
5 "name":"NO_ERROR",
6 "description":"No Error",
7 "permanent":false
8}