Methods
Objects
Send and list SMS.
Method | Description |
---|---|
sms.export_async | Creates an export job to generate a CSV export based on search filters |
sms.get | Get informations on a sent or received SMS. |
Returns the number of SMS that would be billed for a specific content.... | |
sms.get_gsm_charset_mapping | Returns the GSM 03.38 chars, and mapping used when forcing GSM encodin... |
List your inbound or outbound SMS. | |
sms.get_quote | Returns the cost of an SMS for a specific content and destination. Act... |
sms.search | Search through SMS sent or received by your account within the last 6 ... |
sms.send | Send a text message. |
sms.export_async
Creates an export job to generate a CSV export based on search filters
method: sms.export_async
params: [object filters, object webhook]
Parameter | Type | Description | NULL |
---|---|---|---|
filters | object |
Search filters Object: SMS.SearchFilters |
YES |
webhook | object |
Dynamic webhook for this export. Status updates (e.g. when the export is available) will be sent to this specific webhook. You only need to set 'endpoint' and optionally 'options'. Object: Webhook |
YES |
Type | Description | Format/Object |
---|---|---|
string | Job ID | Format: hid (Unique object identifier) |
sms.get
Get informations on a sent or received SMS.
method: sms.get
params: [string id]
Parameter | Type | Description | NULL |
---|---|---|---|
id | string |
SMS ID Format: hash (Unique object identifier) |
NO |
Type | Description | Format/Object |
---|---|---|
object | SMS Object | Object: SMS |
sms.get_count_for_body
Returns the number of SMS that would be billed for a specific content. Actual sending may result in a different count, depending on the final carrier.
This method is DEPRECATED and may be removed in the future.
Relying on this method is highly discouraged.
method: sms.get_count_for_body
params: [string body]
Parameter | Type | Description | NULL |
---|---|---|---|
body | string | Text message | NO |
Type | Description | Format/Object |
---|---|---|
object | Number of SMS billed and encoding | Object: SMS.Quote |
sms.get_gsm_charset_mapping
Returns the GSM 03.38 chars, and mapping used when forcing GSM encoding
method: sms.get_gsm_charset_mapping
params: []
No parameters.
Type | Description | Format/Object |
---|---|---|
array | Charset mapping |
sms.get_list
List your inbound or outbound SMS.
This method is DEPRECATED and may be removed in the future.
Relying on this method is highly discouraged.
method: sms.get_list
params: [string type, string from, string to]
Parameter | Type | Description | NULL |
---|---|---|---|
type | string |
Type of SMS. Values: "IN", "OUT" |
NO |
from | string |
Retrieve from date. Format: datetime (YYYY-MM-DD HH:MM:SS in UTC timezone. Example: "2012-04-24 23:42:00") |
NO |
to | string |
Retrieve to date. Format: datetime (YYYY-MM-DD HH:MM:SS in UTC timezone. Example: "2012-04-24 23:42:00") |
NO |
Type | Description | Format/Object |
---|---|---|
array | SMS list | Array of SMS objects. |
sms.get_quote
Returns the cost of an SMS for a specific content and destination. Actual sending may result in a different count, depending on the final carrier.
method: sms.get_quote
params: [string to, string text, object options]
Parameter | Type | Description | NULL |
---|---|---|---|
to | string |
Destination number Format: phone_number (International E.164 format "+CCNSN". Example: "+16467890800", "+447890123456", or "+33678912345") |
NO |
text | string | Text message | NO |
options | object |
Options what you would use with sms.send Object: SMS.Options |
YES |
Type | Description | Format/Object |
---|---|---|
object | Number of SMS billed, encoding, and cost | Object: SMS.Quote |
sms.search
Search through SMS sent or received by your account within the last 6 months.
method: sms.search
params: [object filters, object options]
Parameter | Type | Description | NULL |
---|---|---|---|
filters | object |
Search filters Object: SMS.SearchFilters |
NO |
options | object |
Search options Object: Search.Options |
NO |
Type | Description | Format/Object |
---|---|---|
object | Search results | Object: Search.Results |
sms.send
Send a text message.
method: sms.send
params: [string from, string to, string body, object options]
Parameter | Type | Description | NULL |
---|---|---|---|
from | string |
The SMS sender. If empty, a shared shortcode will be automatically selected depending on the destination carrier. Otherwise, it must be either a dedicated shortcode, or alphanumeric (at least one character - cannot be digits only). Max length = 11 characters. Depending on your account configuration, you may have to ask our support team to authorize custom Sender IDs. "SMS" is always authorized. Format: sms_sender (a-zA-Z0-9, space, dash, underscore - must contain at least one alpha character) |
NO |
to | string |
The SMS recipient. Format: phone_number (International E.164 format "+CCNSN". Example: "+16467890800", "+447890123456", or "+33678912345") |
NO |
body | string |
Text message. We auto-detect the encoding needed (GSM 03.38 or UNICODE), or you can force the encoding with options.force_encoding (see the "options" parameter). You always send UTF-8 JSON strings - encoding is done at SMS interconnections level. Depending on the encoding, messages may be split into parts at 153 (GSM) or 67 (UNICODE) characters. One SMS sent with this method may be billed as multiple SMS parts. You can check the number of parts sent with the method "sms.get". If you are using a custom sender, you can use the special string %STOPNUM% -- it will be replaced by the STOP number. Max length = 3200 characters. |
NO |
options | object |
SMS Options. Send NULL to use default values. Object: SMS.Options |
YES |
Type | Description | Format/Object |
---|---|---|
string | SMS ID | Format: hash (Unique object identifier) |