If you haven't already first review the general overview of using the create and send campaign methods to send messages via API in the docs here:
To create an SMS you will need to add an SMS message in your post params when calling the create method parameters used in SMS message content are listed below:
Parmeters
Parameter | Description |
---|---|
messages | set to number 9 for SMS i.e. "messages":{ "9":{ SMS_CONTENT PARAMS } |
sms |
A JSON object containing the SMS params "sms":{ |
from | The from header used to identify your brand |
text | the body text of the sms message |
Example
There is sample Post Data below for creating an SMS message. The channel sms is turned on with "sms":1
, the SMS type 9 is added to the messages object with params for the sms content. In this example "broadcast":1
is used to target your entire available user base, conditions that target a subsection of your audience, and scheduling and other options can be added as described in the general overview of campaign methods. In this example a personalisation tag has been added in the SMS text to pull in the users' first names.
URL = api/external/create/campaign POST_DATA ={"apptoken":"YOURAPPTOKEN", "title":"Email Example via API", "sms":1, "broadcast":1, "messages":{ "9":{"sms":{
"from": "xtremepush",
"text": "{{first_name}}, check out our SMS API test" }}}}
Your resulting SMS from above would look something like this one:
Comments
0 comments
Article is closed for comments.