Follow

Send Message To Phone

The Send SMS Message to Phone command allows you to send an SMS Message to a specified Phone number. The command provides the option to send to a Phone number directly without  predefined message content. 

POST /sms/addSubscriberToSenderCode

https://[siteurl]/rest/sms/sendMessageToPhone/[email]/[messageText]/[phone]/[senderCode]

Request Body Parameters

The Send SMS Message to Phone command requires the URI call with the Subscriber Email, one off Message Text, Subscriber Phone, and Sender Code.

Request Body Example

Using Send SMS Message to Phone with all arguments, line breaks in JSON for readability:

curl --request POST \ 
--url 'https://mail.mydomain.com/rest/sms/sendMessageToPhone/jon.doe@mydomain.com/One+time+message+for+you./2065559696/2065551212' \
--header 'authorization: Basic bXlBY2NvdW50Onh5enB3ZDEyMw==' \
--header 'content-type: application/json' \
--header 'accept: application/vnd.whatcounts-v1+json' \
--include

Response Body

The response returns JSON or an HTTP status code.  Based on the first example above, the response returns:

HTTP/1.1 200 OK
Server: serverName
Content-Type: application/json
Content-Length: 456
Date: Fri, 16 Mar 2018 09:10:50 GMT
{
"success": true "statusCode": 0 "smsTrackingSent": { "id": 0 "smsSubscriberId": 0 "realmId": 10 "campaignId": 0 "smsSenderId": 3 "smsTaskId": 0 "smsGroupId": 0 "totalParts": 1 "partSent": 1 "status": 6 "smsPresetMessageId": 0 "smsMessageId": 0 "network": "MM-FIXED" "errorText": "Unroutable message - rejected" "createdDate": "Mar 16, 2018 09:10:50 AM" "updatedDate": "Mar 16, 2018 09:10:50 AM" "delivered": true "lcCampaignId": 0 "lcActionId": 0 "phone": "2065959696" }
}

Error Response

Error Response Codes include both Client Errors (4xx) and Server Errors (5xx).  Descriptions of each can be found in Response Codes.  An error will occur if Message Name or Text is blank, or a Message with the same Name already exists.

For example, if the Sender Code does not exist, the error would appear as:

{
"error": "Error getting sender with senderCode 1 realmID: 10"
"status": "Internal Server Error"
"statusCode": 500
}

Feature added in v12.16.0

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk