The Get SMS Messages command allows you to return the body of all SMS messages for a Realm.
GET /sms
https://[siteurl]/rest/sms
Request Body Parameters
The Get SMS Messages command requires only the URI call. No additional fields are required in the JSON.
Request Body Example
Using Get SMS Messages:
curl --request GET \
--url 'https://mail.mydomain.com/rest/sms' \
--header 'authorization: Basic bXlBY2NvdW50Onh5enB3ZDEyMw==' \
--header 'accept: application/vnd.whatcounts-v1+json' \
--header 'content-type: application/json' \
--include
Response Body
The response returns all SMS Messages defined in the Realm. If more than 500 results are found, the first 500 are displayed, and you must use the "skip" value to view the next 500.
For example, to find the three groups of 500 Messages in an Realm with 1455 Messages , the URIs would be formatted as:
- https://[siteurl]/rest/sms?skip=0
- https://[siteurl]/rest/sms?skip=500
- https://[siteurl]/rest/sms?skip=1000
For more information about "skip", see Pagination.
Based on the example above, and two SMS Messages in the Realm, the response returns:
HTTP/1.1 200 OK
Server: serverName
Content-Type: application/json
Link: <https://mail.mydomain.com/rest/lists>;
Date: Fri, 16 Mar 2018 12:54:44 GMT
{
{
"id": 405
"realmId": 10
"totalParts": 1
"name": "Welcome"
"messageText": "Welcome to our messaging service."
"label": "welcome,sms"
"createdDate": "Dec 19, 2017 6:10:19 PM"
"updatedDate": "Dec 19, 2017 6:10:19 PM"
},
{
"id": 406
"realmId": 10
"totalParts": 1
"name": "Price Drop"
"messageText": "An item you saved is available for less."
"label": "alert,sms"
"createdDate": "Dec 19, 2017 6:13:59 PM"
"updatedDate": "Dec 19, 2017 6:13:59 PM"
}
}
Error Response
Error Response Codes include both Client Errors (4xx) and Server Errors (5xx). Descriptions of each can be found in Response Codes.
For example, if the Authorization is incorrect, the error would appear as:
{
"error": "Unauthorized"
"status": "Unauthorized"
"statusCode": 401
}
Feature added in v12.16.0