Send SMS
Description
Sends an SMS message to a given device or short code.
Users with Essential accounts must purchase the Essential SMS Service package in order to use this API.
Resource URL
POST rws/api/v{apiVersion}/devices/{iccid}/smsMessages
Request Parameters
Parameter | Description |
---|---|
apiVersion |
The version number for this API. The current version for all functions is 1. |
iccid | The ICCID of the device you want information about. |
messageText |
The SMS message text. The maximum length of the message depends on the data coding type (see dataCoding).
If the API does not specify the data coding type, the default maximum message length is 320 characters. Messages that exceed 160 characters appear on two lines. |
messageEncoding | (Optional) The type of message encoding used. Valid values are: LITERAL (default) or BASE64. |
dataCoding |
(Optional) The type of data encoding used.
|
tpvp |
(Optional) The length of time the message is available before expiring. For more information about setting this value, see SMS Validity Period. |
Response Parameters
Return Value | Description |
---|---|
smsMsgId | A unique identifier for the SMS message. You can use this ID to get details about a particular message with the Get SMS Details API. |
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. |
10000017 | 400 | Invalid messageEncoding. |
10000018 | 400 | Invalid dataCoding. |
10000019 | 400 |
Invalid tpvp. Description: The validityPeriod is invalid. |
10000020 | 400 |
Message length exceeds the maximum permissible length. |
10000023 | 400 | The JSON in the request is not well formed. Please ensure that commas, colons, braces etc. are formatted properly. |
10000024 | 400 | Invalid apiVersion. |
10000028 | 400 |
Invalid request. Description: The request contained one or more unrecognized parameters. |
10000030 | 400 | Your role does not have access to this API function. |
10000031 | 400 | Invalid Zone. |
20000001 | 404 | Resource not found - Invalid ICCID. |
30000001 | 500 | Unknown server error. |
30000002 | 500 | Control Center failed to submit the message to the SMSC. |