Request body parameters

This section:

  • Explains what a request body is
  • Provides an example request body



What is a request body?

An API request body is normally used with the POST, PUT and PATCH methods when you are creating or updating resources. The request body is a representation of the resource to be created or edited. For example, if you want to create a new monitoring alert using the API, you make a POST request to the /alerts endpoint.

In the request body you must include:

  • The type of monitoring alert you are creating
  • The unique identifier of the subscriber that is the subject of the alert
  • The upper threshold at which the alert is triggered
  • The lower threshold at which the alert is triggered

Each endpoint's Reference documentation indicates whether a request body is required. Where a request body is required, the documentation highlights:

  • Which fields are mandatory and which are optional
  • A description of each field in the request body
  • An example of a valid request body

Tip

You must provide request bodies in JSON format.



Example request body

The following example displays how you format a request body for the monitoring alerts API.

Request Body Example
{
  "ruleType": "sim",
  "target": "8944999999248275001",
  "lowerThreshold": 512000,
  "upperThreshold": 1,048,576
}

In this example the request body is being used to:

  • Create a subscriber-level monitoring alert - this is defined in the ruleType field
  • Apply the alert to a subscriber with ICCID 8944999999248275001 - this is defined in the target field
  • Set a lower alert threshold of 500KB - this is defined in the lowerThreshold field
  • Set an upper alert of 1MB - this is defined in the upperThreshold field