WhatsApp object
PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
sender | Text sender. Needs to be registered first. For registration contact support here. | Yes | - |
expiration | Time limit after which alternative channel will be used | No | 3600 |
template | Template object. Cannot be used in tandem with following parameters (Message, File, Otp, Location) see Template object | No | null |
message | Message object. Cannot be used in tandem with following parameters (Template, File, Otp, Location) see Message object | No | null |
file | File object. Cannot be used in tandem with following parameters (Template, Message, Otp, Location) see File object | No | null |
otp | Otp object. Cannot be used in tandem with following parameters (Template, Message, File, Location) see Otp object | No | null |
location | Location object. Cannot be used in tandem with following parameters (Template, Message, File, Otp) see Location object | No | null |
Template object
PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
template | Template text | No | null |
language | Language in Iso format | No | en |
header | Template header object, see Header object | No | null |
body | Template body object, see Body object | No | null |
buttons | Array of template button objects, see Buttons object | No | null |
Template header object
PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
type | Type of header (image , video , text , location ) | Yes | - |
url | Path to video, or image (used with image , video type) | Yes, not in tandem with folliwing (text , location ) | - |
caption | Caption of image, or video (used with image , video type) | Yes, not in tandem with folliwing (text , location ) | - |
text | Text (used with text type) | Yes, not in tandem with folliwing (url , caption , location ) | - |
location | Location object (used with location type), see Location object | Yes, not in tandem with folliwing (url , text , caption ) | - |
Template body object
PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
type | Type of body (text , price , currency ) | No | text |
text | Text (used with text type) | Yes, not in tandem with folliwing (amount , currency ) | - |
amount | Amount of set currency | Yes, not in tandem with folliwing (text ) | - |
currency | Currency | Yes, not in tandem with folliwing (text ) | - |
Template buttons object
PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
type | Type of button (payload , url ) | No | url |
index | Index of defined button | Yes | - |
payload | Meta data sent after clickling the button | Yes, only with payload type | - |
text | Url to which recipient will be redirected to | Yes, only with url type | - |
Example of template object request:
{
"application_id": "APPLICATION_ID",
"application_token": "APPLICATION_TOKEN",
"number": [
"+420777777777"
],
"text": "Test text",
"channel": {
"whatsapp": {
"sender": "420777777777",
"expiration": 300,
"template": {
"template": "test_template",
"language": "cz",
"header": {
"type": "image",
"url": "test_url",
"caption": "test_caption"
},
"body": [
{
"type": "currency",
"amount": 20.5,
"currency": "euro"
}
],
"buttons": [
{
"type": "payload",
"index": 1,
"payload": "test_payload"
}
]
}
}
}
}
Example Template object
Message object
PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
text | Text of a message | Yes | - |
preview_url | Preview sent url as a thumbnail | No | true |
Example of message object:
{
"application_id": "APPLICATION_ID",
"application_token": "APPLICATION_TOKEN",
"number": [
"+420777777777"
],
"text": "Test text",
"channel": {
"whatsapp": {
"sender": "420777777777",
"expiration": 300,
"message": {
"text": "title",
"preview_url": true
}
}
}
}
File object
PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
type | Type of file (image , video , audio , document , sticker ) | No | image |
url | Path to the file | Yes | - |
caption | Caption of sent file | No | "" |
Example of File object:
{
"application_id": "APPLICATION_ID",
"application_token": "APPLICATION_TOKEN",
"number": [
"+420777777777"
],
"text": "Test text",
"channel": {
"whatsapp": {
"sender": "420777777777",
"expiration": 300,
"file": {
"type": "image",
"url": "url_test",
"caption": "caption_test"
}
}
}
}
Example File object
Otp object
PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
template | Template of text message being send with the code | Yes | - |
code | One time code | Yes | - |
language | Language used to send the message containing code (if null is used language will be detected from phone number) | Yes | - |
Example of Otp object:
{
"application_id": "APPLICATION_ID",
"application_token": "APPLICATION_TOKEN",
"number": [
"+420777777777"
],
"text": "Test text",
"channel": {
"whatsapp": {
"sender": "420777777777",
"expiration": 300,
"otp": {
"template": "test_template",
"language": "cz",
"code": "0451"
}
}
}
}
Location object
PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
latitude | Latitude in floating point number | No | - |
longitude | Longitude in floating point number | No | - |
name | Name of sent location | No | - |
address | Address of sent location | No | - |
Example of Location object request:
{
"application_id": "APPLICATION_ID",
"application_token": "APPLICATION_TOKEN",
"number": [
"+420777777777"
],
"text": "Test text",
"channel": {
"whatsapp": {
"sender": "420777777777",
"expiration": 300,
"location": {
"latitude": 0.1,
"longitude": 0.1,
"name": "test_name",
"address": "test_address"
}
}
}
}
Example Location object