SMS API

Send SMS notifications to users via API

To start working with the SMS channel, please get in touch with our Sales team or your dedicated Customer Success Manager.‌ Otherwise, sending SMS will not be available.

createSMSMessage

Used to send SMS to users

POST https://api.pushwoosh.com/json/1.3/createSMSMessage

Request Body

Notification parameters

{
  "request": {
    "application": "12345-67891", // required. Pushwoosh application code
    "auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel
    "notifications": [{
      // Content settings
      "send_date": "now", // required. YYYY-MM-DD HH:mm OR 'now'
      "content": "Hello!", // required. SMS text (string)
      "devices":["+1234567890"], // required. Customer phone number (must be associated with a UserId using /registerDevice and specified in the "hwid" parameter or use use_auto_registration). Only one number can be specified here
      "use_auto_registration": true, // optional. Automatically register phone number specified in ‘devices’ parameter
    }]
  }
}

Request example

{
    "request": {
        "application":"YOUR APP CODE", "auth":"AUTH TOKEN",
        "notifications":[{
            "send_date":"now",
            "content":"Hello!",
            "devices":["+1234567890"],
            "use_auto_registration": true
        }]
    }
}

Response example

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "Messages": [
            "9648-0B10ECB6-0D9F214D"
        ]
    }
}

Error response

{
    "status_code": 210,
    "status_message": "Invalid devices list. \"devices\" must be an array.",
    "response": {
        "Messages": []
    }
}

Currently, each SMS must be sent in a separate request for each customer.

2. To get SMS statistics, use the getMsgStats method. In the action parameter, you can get the delivery status.

You can also view statistics for each message in the Message History section.

Please note that some mobile operators do not transmit delivery status data, so the statistics may need to be more accurate. You can check the details with the mobile operators that provide numbers to your customers.

Last updated