Use this REST API, along with your OAuth credentials to send a published SMS message to a contact source, with the ability to pass in a message name.
Prerequisites to API SMS send
- Your Acoustic Campaign org must have SMS enabled by provisioning.
- A database in the Acoustic Campaign org must have SMS enabled.
- An org user with the SMS feature enabled and a valid auth token that is used when making the API calls.
- A user that has created an SMS message that is published on this org.
Note:
Up to 10 concurrent requests are allowed to our API servers at any given time when using the OAuth method for authentication.
Once this is set up, you can send a published SMS message to a contact source.
End Point
/channels/sms/publishedmessages/{publishedMessageId}/sendjobs
Attribute | Description | Example |
---|---|---|
publishedMessageId [required] | The ID (UUID) of the published SMS message that is being sent. String, | e3c3d1ea-e54b-458d-b32b-18a99f63b58c The ID of the published message can be found in your Campaign Automation organization by going to the Mobile Messages And Templates area under Content. Click on the Published tab, locate the published SMS message you wish to send, and copy and paste the value found in the Content ID column. |
contactSourceId [optional] | The contact source's ID can be provided. It can be a database, query, or contact list, and it must be enabled for SMS(or associated with a database that is enabled for SMS, in the case of the query and contact list). Long, If a contact source ID element is provided in the API call, that will be used while sending the SMS instead of the contact source ID in the published SMS message. If a contact source ID element is not provided in the API call, the contact source ID on the published SMS message will be used. | 4396816 |
externalSystemName [optional] | Provision for the calling system to pass a Name representing the calling system. If not passed, Campaign Automation defaults this to API. String, | Campaign |
externalSystemReferenceId [optional] | Provision for the calling system to pass a Reference Identifier, this will be passed back in SMS events to subscribing system. String, | Param_12345_test |
messageName [required] | Unique value for the message name. String, | OfferToUpdateAPIpage |
scheduledDate [optional] | Date on which the SMS is to be sent, represented in a String as per RFC 3339. If this parameter is not provided, API will process as Send now. Date, | 1970-01-01T00:00:00.000+00:00 |
preBlockingHours [optional] | Value representing the blocking time before sending the SMS. Integer, | 4 |
Sample Payload
{ “externalSystemName”: “Campaign”,
“externalSystemReferenceId”: “Param_12345_test”,
“messageName”: “OfferToUpdateAPIpage”
}
Response Format
Sample output for above request:
Response Code : 201 //Success
Response Body :
{
“meta”: {
“attributes”: {},
“generalErrors”: [],
“fieldErrors”: {},
“links”: [],
“nextPageUrl”: null
},
“data”: {
“location”: “http://engage-qa1-api.adm01.com/rest/channels/sms/sendjobs/4396816”,
“id”: 4396816
}
}
Response codes
Scenario | Response Code | Message |
---|---|---|
Success | 201 | Accepted |
Failure | 400 | Failure |
Contact source is not SMS enabled | 400 | Contact source is not enabled for SMS. |
User calling the API is not SMS enabled | 403 | Forbidden |
Contact source does not exist | 400 | Contact source ID does not exist. |
Contact source is not in this org | 400 | Contact source access denied |
No ID provided | 404 | n/a |
Provided ID does not exist | 400 | Unable to find published DeliveryDraft with contentId |
Provided ID is not in this org | 403 | Forbidden |
Provided ID existed but was deleted | 400 | Unable to find published DeliveryDraft with contentId |
Contains characters NOT whitelisted for use in UI | 201 | Success |
Contains all spaces | 400 | Invalid message name |
Has leading or trailing spaces | 201 | Success |
Message name is not unique | 400 | A SMS with the name: already exists |
value >2000 chars | 400 | Length of External System Name cannot exceed 2000 characters. |
value > 2000 chars | 400 | Length of External System RefrenceId cannot exceed 2000 characters. |
Test Your API Call
Use Swagger to test your API call. To access the Swagger environment for your Org, replace {POD#} with the Pod where your Org exists:
https://api{POD#}.silverpop.com/restdoc/#!/channels/send_sms_to_contact_source_post_15
For example, here's the link to use if your Org is on Pod 1:
https://api1.silverpop.com/restdoc/#!/channels/send_sms_to_contact_source_post_15