Send a Text Message API

Allows the delivery of text messages from a platform external to the Wunderkind ecosystem (ESP, CDP, etc.).

Introduction

This is a guide to using Wunderkind's Text Message APIs; Wunderkind's Text Message API exposes 5 RESTful endpoints. These allow clients to:

  • Send text messages through the Wunderkind platform
  • Call the status of the sent text message
  • Check the subscription status of a user within the Wunderkind text program
  • Unsubscribe a user (or group of user's) from the Wunderkind text program

Limitations

  • Rate limit: 300 requests/second/website
  • Automated callbacks to client owned endpoints do not have retry logic implemented

URL

POST https://api.wknd.ai/text/message/send

Request Headers

The following are used for authentication/authorization checks.

X-Client-ID: A 32-byte hashed string provided by Wunderkind.

X-Client-Secret: A 64-byte hashed string provided by Wunderkind.

Body Parameters

Model:

The following are used for authentication/authorization checks.

Body Parameters

Model:

{
    "phone": "string",
    "email": "string",
    "text": "string",
    "mediaUrl": "string",
    "clickUrl": "string",
    "callbackData": "string",
    "sendPurpose": "string"
}

  • phone (optional) E. 164 formatted phone number, e.g. +19191234567. This field can be empty if email is specified. Either phone or email must be specified
  • email - (optional) the email address will be used to look up the subscribed phone number whichthe message will send to. This field can be empty (or will be ignored even if filled) if the phone is specified. Either phone or email must be specified.
  • text - (required) the content of the text message
  • mediaUrl - (optional) the url of the media (e.g. an image)
  • clickUrl - (optional) the url of the click link. The url will be shortened to a txts.ly tracking link. The click through link can include any custom parameters for tracking
  • callbackData - (required) json formatted string. The json formatted metadata will be appended to the callback request payload for tracking purposes. This can be used to tie the message status to the user profile.

Note: If your system does not require a callback, please utilize a dummy value

"callbackData": ""

  • sendPurpose - (required) used for passing the purpose/use case of the text API send. This

    value is used for Wunderkind internal reporting and can be an internal campaign id, tracking code or a short string. This field supports an alphanumeric string including “-”, ”_” and spaces between words.e.g. ‘test-send purpose’, ‘code_1’, etc. (Input Length: Maximum 100 characters)

Responses

Success Response - 200

Model:

{
    "messageId": "string"
} 

messageId the ID to distinguish the specific text message to the end user. This value is automatically generated by Wunderkind system, e.g. b2f25e55-3967-4434-a214-87bb7c8ed013

Error Responses

Model:

{
    "code": 0,
    "message": "string",
    "details": []
} 

  • code - error code
  • message - error message
  • Details - (optional) additional info will be appended here

Error Codes

  • 401 - Unauthorized
  • 403 - Forbidden
  • 429 - Denied (exceed the limits)
  • 4XX(others) - Bad Request
  • 5XX - Internal Server Error

Responses

Request:

curl -X 'POST' \
'https://api.wknd.ai/text/message/send' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'X-Client-ID: ********s19bvx18vly70bk5********' \
-H 'X-Client-Secret: ********c2a4b82f10f8a137b1b056c6f3f3909ddc062a6fb6b4826c********' \
-d '{
  "phone": "+19191234567",
  "email": "",
  "text": "Brand: test message",
  "mediaUrl": "https://www.example.com/testimg.png",
  "clickUrl": "https://www.example.com/clickme",
  "callbackData": "{\"profileID\":\"123456789\",\"Flow\":\"Example Flow\"}"
 }'

Response:

{
    "messageId": "f9eea82a-ce63-4dfa-ae8e-09b891f446cc"
}