Search SMS
Description
Returns a list of SMS message IDs associated with a particular account during a specified time period. Optionally, you can restrict the search to a specific device.
The function returns messages between Control Center and a device. You cannot get information about messages exchanged between a device and a non-Control Center SMS client.
Users with Essential accounts must purchase the Essential SMS Service package in order to use this API.
Resource URL
GET rws/api/v{apiVersion}/smsMessages
Request Parameters
Parameter | Description |
---|---|
apiVersion |
The version number for this API. The current version for all functions is 1. |
accountId |
(Optional) Unique identifier for the account associated with the messages you want to retrieve. |
iccid | (Optional) Restricts the list of returned messages to just those messages sent or received by a particular device. This device must be owned by the specified account. |
fromDate | A date and time using the ISO 8601 format (see Date Formats). The function returns any messages that were sent or received on or after this date. |
toDate | (Optional) A date and time using the ISO 8601 format (see Date Formats). Use this parameter to specify a particular period of time for the messages. If you do not specify a toDate, Control Center returns all messages up to the current date and time. |
msgType | (Optional) Indicates whether the message was sent by the device (MO, mobile-originated) or received by the device (MT, mobile-terminated). |
pageSize |
(Optional) Specifies the number of records returned in each response page. The maximum value is 50. The value defaults to 50. |
pageNumber |
(Optional) Specifies the number of response pages to return. This value defaults to 1. |
Response Parameters
The function returns an array of SMS message IDs. Records are sorted by modification date in ascending order with the oldest message listed first.
Return Value | Description |
---|---|
smsMsgIds | An array of message identifiers. You must use the Get SMS Details API to retrieve the content of each message. |
pageNumber |
An integer specifying the number of the current page. |
lastPage |
A true or false value indicating whether the current page is the last in the series. |
Request Example
Make sure to use your own user credentials. See Authentication for information about creating an authorization header.
Response Example
Code Samples
Make sure to use the Control Center sandbox URL and your own user credentials.
Errors
Error Code | HTTP Code | Error Message |
---|---|---|
10000001 | 401 |
Invalid credentials. Description: Control Center uses this error message when the API credentials are invalid or when the IP address is not within the allowed range. |
10000002 | 400 | AccoundId is required. |
10000004 | 400 | Invalid accountId. |
10000006 | 400 | Invalid pageSize. |
10000007 | 400 | Invalid pageNumber. |
10000012 | 400 | Invalid date format. |
10000021 | 400 | Invalid iccid. |
10000022 | 400 | FromDate is required. |
10000024 | 400 | Invalid apiVersion. |
10000027 | 400 | ToDate must be after fromDate. |
30000001 | 500 | Unknown server error. |
101000022 | 400 | Invalid message type. |