API: Rest SMS Overview

The Rest API supports the ability to manage SMS Messages and Contacts, as well as send Messages.  The Rest API URI for SMS resource is in the format:

https://[siteurl]/rest/sms

Commands

API Commands for SMS management include:

Name

HTTP Method

Endpoint

Description

Create Message

POST

/rest/create_message

Create message content to send via SMS

Get Messages

GET

/rest/sms

Get body of each SMS message for a Realm.

Add Phone to Sender Code

POST

/rest/sms/addPhoneToSenderCode/{phone}/{sender_code}?groupName=[group_name]

Subscribe an existing SMS contact to an SMS Sender Code

Add SMS Contact to Sender Code

POST

/rest/sms/addSubscriberToSenderCode/{email}/{phone}/{sender_code}/{country}/?groupName=[groupname]&first=[first_name]&customerKey=[customer_key]

Subscribe an existing SMS and Email contact to an SMS Sender Code

Send Message to Phone

POST

/rest/sms/sendMessageToPhone/{messageText}/{phone}/{senderCode}

Send an SMS Message to a specified Phone number without  predefined message content.

Send Message to Sender Code

POST

/rest/sms/sendMessageToSenderCode/{messageName}/{senderCode}/{name}?description=[description]&groupName=[group_name]

Send an SMS Message to all Contacts assigned to a Sender Code or Group

Stop Sending to Contact

POST

/rest/sms/stopSubscriberSend/{phone}/{senderCode}

Unsubscribe an existing SMS contact from an SMS Sender Code

 

SMS Message Property Data Fields

The following data fields may be set and viewed for SMS Messages.  You will notice that there are properties which are available within the UI that are not available in the API.  These must be edited within the UI only.   

Field Name

Methods

Description

Type

Example

ID

GET

Unique ID of the Message

Integer

"id": [messageId]

Realm ID

GET

ID of Realm

Integer

"realmId": [realmId]

Total Message Parts

GET

 Number of separate message parts.

Integer

"totalParts": [number of parts]

Name

POST,  GET

Unique Name of the Message.

String 

"name": "[messageName]"

Text

POST, GET

Content of the message

String

"messageText": "[messageText]" 

Created Date

GET 

Date the Message was created. 

Date 

"createdDate": "Mar 22, 2018 4:05:11 PM"

Updated Date

GET 

Last date that changes were made and saved to the Message.

Date 

"updatedDate": "Mar 23, 2018 12:45:04 PM"