Follow

Send Message To Sender Code

The Send SMS Message to Sender Code command allows you to send an SMS Message to all Subscribers assigned to a Sender Code or Group.

POST /sms/sendMessageToSenderCode

https://[siteurl]/rest/sms/sendMessageToSenderCode/[messgeName]/[senderCode]/[name]?queriestring

The following queries are supported:

description=[string]
groupName=[string]
  

Request Body Parameters

The Send Message to Sender Code command requires the URI call with the Message Name, SMS Sender Code, and Campaign Name. Optional Filters include a Description and the Group Name parameter. 

The query strings 'description' and 'groupName' are case sensitive and must be defined as in the example above.  The Group Name must be defined for the Account in order to save.  If the query string is incorrect or missing, it is ignored and the command creates a message with no Group and/or Description.

Request Body Example

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

curl --request POST \ 
--url 'https://mail.mydomain.com/rest/sms/sendMessageToSenderCode/welcome/2065551212/Welcome+Campaign?description=daily&groupName=daily' \
--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
{
"id": 274 "realmId": 10 "smsMessageId": 443 "smsSenderId": 3 "smsGroupId": 42 "smsSubscriberCount": 0 "campaignId": 0 "lcCampaignId": 0 "lcActionId": 0 "name": "Welcome Campaign" "description": "daily" "status": "submitted" "createdDate": "Mar 16, 2018 09:10:50 AM" "updatedDate": "Mar 16, 2018 09:10:50 AM"
}

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 a Message with the specified name does not exist, the error would appear as:

{
"error": "Message name Not Found."
"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