Follow

SMS Sync API

SMS Sync API

This REST API enables you to send to Kahuna SMS do not call and opt-in information you detect. Using this information, Kahuna can avoid sending SMS messages to users who do not want to be messaged or start resending messages to users who have opted back in.

API Request

Request URI and Header

 

Request URI - HTTP POST

To target the production environment: https://tap-nexus.appspot.com/api/smssync?env=p

To target the sandbox environment: https://tap-nexus.appspot.com/api/smssync?env=s

 

Request Header

Content-Type: application/json

Authorization: The API uses Basic Authentication (BasicAuth), which requires credentials in the form of a username (Secret Key) and password (API Key).

The Secret Key and API Key for the namespace are:

Secret Key: Available in Settings
API Key: Available in Settings
Request Body

The body of the request must contain a list of dictionaries, described below. You can make multiple requests concurrently.

Parameters
number

Required. A string that identifies the mobile phone number.

timestamp

Optional. The time the opt-in or do not call information was received, in seconds in Unix time (Epoch time).

opt-in

Specify true if the user opted back in by texting START, YES, or UNSTOP.

Omit the opt-in parameter if the mobile phone number is unreachable (the number is invalid or there is no routing) or the user opted out by texting STOP, STOPALL, UNSUBSCRIBE, CANCEL, END, or QUIT.

Example
[
  {
    "number": "1234567890123", 
    "timestamp": 1477605600, 
    "opt-in": true
  },  
  {
    "number": "9876543219876", 
    "timestamp": 1477605600
  }
             
]

API Response

The response for authentication requests is:

  • Non-200 if there are any errors that prevent all data from being processed.
  • 200 with accepted and rejected counts.

The response payload also includes an errors list if data is rejected.

Examples

Example response without error list:

{
    "accepted" : 3,
    "rejected" : 0
} 

Example request with errors:

[
    {
       "number": "1234567890123",
        "timestamp": 1477605600,
        "opt-in": true
    },  
   {
        "number": "9876543219876",
        "timestamp": 1477605600
    },
    {
        "timestamp": 1477605600
    },
    {
        "number": "16789012345",
        "timestamp": "2017-06-19 12:00:00 PM"
        "opt-in": true
    }
]

Example response with error list for the request shown above:

{
    "accepted": 2,
    "rejected": 2,
    "errors": [
                  ["Invalid Row", null, false, 1477605600],
                  ["Invalid Type", "16789012345", true, "2017-06-19 12:00:00 PM"]
              ]
}
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments