Skip to content

SMS API

createSMSMessage

Used to send SMS notifications to users

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

Request Body

NameRequiredTypeDescription
auth*YesstringAPI access token from Pushwoosh Control Panel.
application*YesstringPushwoosh application code.
notifications*YesarrayContent settings. JSON array of message parameters. See details below.

Notification parameters

NameRequiredTypeDescription
send_date*YesstringDate and time to send the notification. Use format YYYY-MM-DD HH:mm or now to send immediately.
content*YesstringText content of the SMS message.
devices*YesarrayCustomer 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_registrationNobooleanIf set to true the phone number specified in the devices parameter will be automatically registered.
dynamic_content_placeholdersNoobjectDynamic content placeholders to customize the message content. Each placeholder will be replaced with corresponding dynamic values.
presetNostringSMS Preset Code from your Control Panel.

Request example

{
"request": {
"application": "12345-67891", // required. Pushwoosh application code.
"auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel.
"notifications": [{
"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.
"preset": "XXXXX-XXXXX", // optional. SMS Preset Code from your Control Panel.
"use_auto_registration": true // optional. Automatically register phone number specified
// in "devices" parameter.
}]
}
}

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": []
}
}

To get SMS statistics, use the totalsByIntervals method.

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