PATCH request to the /alerts/{id} endpoint.
View the reference documentation
The API Reference describes the endpoints in the API, what they are used for, and the mandatory and optional information to include in your calls.Create an access key
The Portal API uses access keys to validate that calls come from permitted sources. Before you start, create an access key and copy it to a secure location.For instructions, see Authenticate API calls.
Add parameters
In this example, for the/alerts/{id} endpoint, the path parameter is {id}.
The reference documentation for this endpoint shows that you must include the id of the alert that you want to edit. If you do not include this mandatory parameter, the call results in an error.
To include a parameter in your request, replace the braces and the placeholder inside them with an actual value. For example, if the unique identifier of the monitoring alert you want to edit is 24, the request URL is:
For more information about parameters, see Add path parameters.
Add a request body
The reference documentation for this endpoint shows that you must provide a request body. The request body sets the monitoring alert’s new lower and upper usage thresholds, in bytes. The following request body sets the lower threshold to 500 KB (512000 bytes) and the upper threshold to 1 MB (1048576 bytes):
id parameter and the request body:
For more information about request bodies, see Add a request body.
Add your access key
To validate that you have permission to access the Portal API, include your access key as a Bearer token in theAuthorization header.
The following example shows the complete call with the path parameter, request body, and access key. Replace YOUR_ACCESS_KEY with your own access key:
For more information about access keys, see Authenticate API calls.
Interpret the response
If the call succeeds, the endpoint returns a response code in the2xx range and a response body containing the updated monitoring alert.
The following example shows how the response body might look:
- The
idfield, which contains the monitoring alert’s unique identifier. - The
ruleTypefield, which contains the type of alert. - The
targetfield, which identifies the SIM to which the monitoring alert applies. - The
lowerThresholdfield, which contains the lower usage threshold, in bytes, at which the alert is triggered. - The
upperThresholdfield, which contains the upper usage threshold, in bytes, at which the alert is triggered. - The
dateCreatedfield, which contains the date and time at which the alert was created.
4xx code usually means a problem with your request, such as an invalid alert id or a missing permission.
For more information about handling API responses, see Handle responses and Response and error codes.
.png?fit=max&auto=format&n=O_uzD3MzmB0GjlUt&q=85&s=c270436c68c018116479c3f4011acaaf)
