WhatsApp API
createWhatsAppMessage
Used to send WhatsApp messages to users
POST
https://api.pushwoosh.com/json/1.3/createWhatsAppMessage
Request Body
Name | Required | Type | Description |
---|---|---|---|
auth* | Yes | string | API access token from Pushwoosh Control Panel. |
application* | Yes | string | Pushwoosh application code. |
notifications* | Yes | array | Content settings. JSON array of message parameters. See details below. |
Notification parameters
Name | Required | Type | Description |
---|---|---|---|
send_date* | Yes | string | Date and time to send the notification. Use format YYYY-MM-DD HH:mm or 'now' to send immediately. |
content | Required if content_id is not provided. | string | Text content of the WhatsApp message. |
content_id | Required if content is not provided. | string | Identifier for a pre-approved WhatsApp template from your Meta account. |
devices* | Yes | array | 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 | No | boolean | If set to true , the phone number specified in the devices parameter will be automatically registered. |
content_variables | No | object | Content variables to customize the message content. Each placeholder will be replaced with corresponding dynamic values. |
button_url_variables | No | object | Dynamic URL variables for buttons. Each key represents a button index, and its value is the dynamic variable to replace in the button’s URL. Note: Button indexing starts at 0, with the first button as 0, the second as 1, and so on. |
header_variables | No | object | Variables for the header in a WhatsApp template message. Specify the type (e.g., text , image , video , document ) and the corresponding value. Example: "header_variables": {"image": "https://image-url.png"} |
preset | No | string | WhatsApp Preset Code from your Control Panel. |
language | No | string | Language locale of the WhatsApp template (must match the locale in Meta WhatsApp template editor). Default: "en_US" . Example: "en_GB" . |