Interpret a response body

The API generates a response to each API call. The response consists of a response code and a response body. The response code indicates whether your call succeeded or failed. The response body contains the data you requested, or an error message.

If your request succeeds, the endpoint returns a response code in the 200 range, and a response body that contains the data you requested, or the details of the resources that you created, edited or deleted.

Info: For information about response and error codes, see the topic Response and error codes.

Note: The content and structure of a response body varies depending on the endpoint. You can see a response example and response schema for every endpoint in the API Reference documentation.

The following example shows a response body from the /alerts endpoint. This example contains the details of a monitoring alert that was created using the API.

{
 "contents": [
  {
   "id": "24",
   "ruleType": "sim",
   "target": "447000000001",
   "lowerThreshold": "1048576",
   "upperThreshold": "2097152",
   "dateCreated": "2018-02-11T10:33:30.000Z"
  }
 ]
}

The response body is composed of the following parts:

  • The id field contains the monitoring alert's unique identifier.
  • The ruleType field contains the type of alert.
  • The target field contains the MSISDN of the SIM to which the monitoring alert applies.
  • The lowerThreshold field contains the number of bytes for the lower usage threshold at which the alert is triggered .
  • The upperThreshold field contains the number of bytes for the upper usage threshold at which the alert is triggered.
  • The dateCreated field contains the date and time at which the alert was created.