HTTP api responses
Our application always sends a Json response containing information about the submitted request.
In the event of a successful operation, response is as follows:
{
"total_queued": 2,
"total_parts": 4,
"details": [{
"uuid": "123e4567-e89b-12d3-a456-426655440000",
"customer_uuid": "xxxx-yyyy-zzzz",
"queued": 2,
"parts": 4,
"quality": "H"
}]
}
Response elements details:
Name | Type | Format | Description | Always present |
total_queued | number | integer | total successfully queued messages | YES |
total_parts | number | integer | total SMSs used to send all messages | NO |
details | array | json | details of every 'message' array present in request | YES |
uuid | text | string | unique id generated by our platform | YES |
customer_uuid | text | string | 'uuid' element present in request | NO |
queued | number | integer | total successfully queued messages for this 'message' array | YES |
parts | number | integer | total SMSs used to send all messages for this 'message' array | NO |
quality | text | string | messages quality | YES |
total_parts and parts will be present in response body only if the request contains at least one concatenated SMS (message text length > 160 characters).
details will contain one element for each 'message' element present in request body.
customer_uuid will be present only if element 'uuid' is present in request body.
In the event of a unsuccessful operation, mediariver will reject every message in the request and will reply with a http 400 status (429 in the event of too many requests per time interval) and a json body as follows:
{
"errors": [
{
"location": "/messages/0/quality",
"message": "should be equal to one of the allowed values"
}
]
}
errors array contains one element for each request's error.
location element contains the wrong element position in request.
message element contains the error description.
HTTP authorization specific errors (no location will be provided):
'No credentials provided'
'Credentials rejected'