How it Works
The SMS External Consent REST API allows the user to send transactional SMS messages to contacts who might or might not be in the Acoustic Campaign SMS database.
Use Case
This REST API allows sending transactional SMS messages to contacts and who might or might not have SMS consent in the SMS database. In this type of situation, consent is managed externally to the SMS database. Typical usage of this API, for example, sending a one-time security code for a password change to the user or air flight gate change.
Requirements to use this API
- Your Acoustic Campaign org must have SMS enabled by provisioning.
- A database in your Acoustic Campaign org must have SMS enabled.
- The user making the API call must be enabled for SMS.
- The user making the API call must have valid OAuth credentials.
Note:
Up to 10 concurrent requests are allowed to our API servers at any given time when using the OAuth method for authentication.
Note:
This API supports inline personalization and does not check for consent nor does it resend if the SMS send fails.
Items of Note
- Contact does not have to be in the SMS database.
- SMS phone number is added to the database. Adding the Contact to the Acoustic Campaign database allows to send Universal Behaviors, which enable Reporting.
- Contacts can be cleared from the database by using the Purgefeature. Run a Query on the CREATED_FROM field to identify contacts that are added by the SMS External Consent API.
Endpoint
/channels/sms/externalconsentsends
Parameters for SmsExternalConsentSendPayload
Attribute | Description | Example |
---|---|---|
Content | Content for SMS, string, required | Hey %%FIRST NAME%%! Happy birthday!! |
Contacts | List of contacts (Phone Number must include Country Code). API accepts max 1000 contacts, array, required | Use Contact ID or Contact Lookup |
Channel Qualifier | SMS Program ID, string, required | 12345 |
Personalization Defaults | Value to return if personalization data is not found for a contact., map, optional | FIRST NAME: Valued Customer |
Source | Attribute returned as part of the Universal Behavior event., string, optional | Transaction ID 1234 |
Parameters for SmsExternalConsentContact
Attribute | Description | Example |
---|---|---|
Phone Number | Phone Number with Country Code of the Contact from List, string, required | 19495001234 |
Personalization | Map of key value pairs for personalization, map, optional | Tracking: Z12A34567 |
Sample Payload
{ “content”:”Hello. Here is the PIN you requested %%PIN%%.”, “contacts”:[ { “phoneNumber”:”19492319304″, “personalization”:{ “PIN”:”1234″ } } ], “channelQualifier”:”129856″, “source”:”” }
Response Codes
Scenario | Code | Message |
---|---|---|
Success | 202 | Response body includes API response location and Response ID |
Personalization tag does not match DB field name | 400 | Wrong personalization tags {personalization tag} |
Improper JSON format | 400 | Bad request |
Invalid SMS program ID | 400 | SMS Program is inactive or not found with identifier {SMS Program ID}. |
SMS program is inactive | 400 | SMS Program is inactive or not found with identifier {SMS Program ID}. |
SMS program is empty | 400 | Channel qualifier should be present |
SMS content exceeds 800 characters | 400 | The message exceeded the maximum 800 character limit. |
SMS content is empty | 400 | SMS content should be present |
Contact array has more than 1000 contacts | 400 | Contacts must contain at least 1 contact and cannot exceed more than 1000 contacts. |
API call does not include a Contact ID or Contact Lookup | 400 | Contact information is empty. Please provide contact identifier or lookup keys. |
Expired access token | 401 | The access token has expired. Token provided was: {Token} |
SMS is not enabled for Org, database or user | 403 | Forbidden |
Check Status of SMS Sent using the SMS External Consent API
SMS messages sent using the External Consent API will not appear in the Campaign user interface. However, you can view send status in the SMS Campaign Manager user interface by selecting Messages.
To check the status of the SMS send, you’ll need the transaction ID returned in the External Consent API response body. Provide this transaction ID in the Get SMS Status API call to return the send status for contact(s) included in the API call.
Note:
You can only check the status of the SMS messages and not the status of SMPP SMS messages. The Get SMS Status API does not support reporting the status of SMPP SMS messages.
Endpoint
/channels/sms/sends/{transactionId}/status
Parameters
Attribute | Description | Example |
---|---|---|
ID generated from the Response Body of the SMS External Consent REST API call | A transaction id returned by POST /channels/sms/sends, string, required | 6adb75b2-158df6e11e8-fe154a13e7aff661200edcf73 |
Sample Response Body
{
“meta”: {
“attributes”: {},
“generalErrors”: [],
“fieldErrors”: {},
“links”: [],
“nextPageUrl”: null
},
“data”: {
“totalContacts”: 2,
“contactsProcessed”: 2,
“contactStatus”: [
{
“smsSent”: false,
“message”: “Invalid phone number.”,
“phoneNumber”: “1×833920903”
},
{
“smsSent”: true,
“phoneNumber”: “19492319304”
}
],
“errors”: []
}
}
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/sms_to_contacts_post_1
For example, here's the link to use if your Org is on Pod 1:
https://api1.silverpop.com/restdoc/#!/channels/sms_to_contacts_post_1