Send Bulk Text Messages API

Allows the delivery of bulk text messages from a platform external to the Wunderkind ecosystem (ESP, CDP, etc.).Request Body can have max 50000 messages per request and a minimum of 1. #

URL

POST https://api.wknd.ai/text/bulk/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:

{
   "messages": [
      {
         "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:

{
      "successSent": [
       {
           "status": "string",
           "messageId": "string",
           "phone": "string",
           "email": "string"
       }
    ],
    "failedSent": [
       {
           "errorMessage": "string",
           "phone": "string",
           "email": "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

Examples

Request:

curl --location 'https://api.wknd.ai/text/bulk/message/send' \
--header 'X-Client-ID: ******16s1f59j10fc1z8vx4d8******' \
--header 'X-Client-Secret: ************ejcixob33u5dbr4vix5octiqc0gjrtq3f506fueb************' \
--header 'Content-Type: application/json' \
--data-raw '{
       "messages": [
          {
              "phone": "+12017XXX891",
              "email": "",
              "text": "type your message here.",
              "mediaUrl": "https://www.example.com/testimg.png",
              "clickUrl": "https://www.example.com/clickme",
              "callbackData": "client can put the json formatted metadata here, when our system hit the webhook to update the message status, this '\''callbackData'\'' will be appended in the request payload",
              "sendPurpose": "example_bulk_send"
         },
        {
             "phone": "",
             "email": "",
             "text": "type your message here.",
             "mediaUrl": "https://www.example.com/testimg.png",
             "clickUrl": "https://www.example.com/clickme",
             "callbackData": "client can put the json formatted metadata here, when our system hit the webhook to update the message status, this '\''callbackData'\'' will be appended in the request payload",
             "sendPurpose": "example_bulk_send"
        }
    ]
}'

Response:

{
     "successSent": [
          {
               "status": "Accepted",
               "messageId": "ea5fe19f-31e8-441f-bf7e-8bed1bf8927f",
               "phone": "+12017XXX891",
               "email": ""
          }
  ],
  "failedSent": [
         {
             "errorMessage": "Email, Phone or text is required",
             "phone": "",
             "email": ""
         }
    ]
}