Using this API you can send different types of messages to users. The different types of message objects are described here.
Message object description for different types
of messages
types
of messagesText message
{
"type":"text",
"text":"Hello user, how are you?"
}
Key | Type | Description | Sample |
---|---|---|---|
| string | Required | Hello user, how are you? |
Image message
{
"type":"image",
"originalUrl":"https://www.buildquickbots.com/whatsapp/media/sample/jpg/sample01.jpg",
"previewUrl":"https://www.buildquickbots.com/whatsapp/media/sample/jpg/sample01.jpg",
"caption":"Sample image"
}
Key | Type | Description | Sample |
---|---|---|---|
| string | Public URL of the image hosted. | https://www.buildquickbots.com/whatsapp/media/sample/jpg/sample01.jpg |
| string | Public URL of the thumbnail of the image. | https://www.buildquickbots.com/whatsapp/media/sample/jpg/sample01.jpg |
| string | Optional | Sample image |
File message
{
"type":"file",
"url":"https://www.buildquickbots.com/whatsapp/media/sample/pdf/sample01.pdf",
"filename":"Sample file"
}
Key | Type | Description | Sample |
---|---|---|---|
| string | Public URL of the file hosted | https://www.buildquickbots.com/whatsapp/media/sample/pdf/sample01.pdf |
filename | string | Name of the file | Sample file |
Audio message
{
"type":"audio",
"url":"https://www.buildquickbots.com/whatsapp/media/sample/audio/sample02.mp3"
}
Key | Type | Description | Sample |
---|---|---|---|
| string | Public URL of the audio file. | https://www.buildquickbots.com/whatsapp/media/sample/audio/sample01.mp3 |
Video message
{
"type":"video",
"url":"https://www.buildquickbots.com/whatsapp/media/sample/video/sample01.mp4"
}
Key | Type | Description | Sample |
---|---|---|---|
| string | Public URL of the video file. | https://www.buildquickbots.com/whatsapp/media/sample/video/sample01.mp4 |
| string | Optional | Sample caption |
Sticker message
{
"type":"sticker",
"url":"http://www.buildquickbots.com/whatsapp/stickers/SampleSticker01.webp"
}
Key | Type | Description | Sample |
---|---|---|---|
| string | Public URL of the sticker file. | http://www.buildquickbots.com/whatsapp/stickers/SampleSticker01.webp |
Interactive - List message
{
"type":"list",
"title":"title text",
"body":"body text",
"msgid":"list1",
"globalButtons":[
{
"type":"text",
"title":"Global button"
}
],
"items":[
{
"title":"first Section",
"subtitle":"first Subtitle",
"options":[
{
"type":"text",
"title":"section 1 row 1",
"description":"first row of first section description",
"postbackText":"section 1 row 1 postback payload"
},
{
"type":"text",
"title":"section 1 row 2",
"description":"second row of first section description",
"postbackText":"section 1 row 2 postback payload"
},
{
"type":"text",
"title":"section 1 row 3",
"description":"third row of first section description",
"postbackText":"section 1 row 3 postback payload"
}
]
},
{
"title":"second section",
"subtitle":"second Subtitle",
"options":[
{
"type":"text",
"title":"section 2 row 1",
"description":"first row of second section description",
"postbackText":"section 1 row 3 postback payload"
}
]
}
]
}
Key | Type | Description | Note |
---|---|---|---|
| string | The title/header text for the list message |
|
| string | The body text for the list message |
|
| string | Optional | |
| array | ||
| array | Up to 10 items supported. |
globalButtons
array description
globalButtons
array descriptionKey | Type | Description | Note |
---|---|---|---|
| string | Only |
|
| string | The title of the global button |
|
items
array description
items
array descriptionKey | Type | Description | Note |
---|---|---|---|
| string | The title of a section in the list message. | Maximum characters: 24 |
| array | Contains list of items in a section. |
options
array description
options
array descriptionKey | Type | Description | Note |
---|---|---|---|
| string | Only text is supported | |
| string | The title of the item in the list. | Maximum characters: 24 |
| string | Optional | Maximum characters: 72 |
| string | Optional |
Interactive - Quick reply message
{
"type":"quick_reply",
"msgid":"qr1",
"content":{
"type":"text",
"header":"this is the header",
"text":"this is the body",
"caption":"this is the footer"
},
"options":[
{
"type":"text",
"title":"First",
"postbackText": "dev-defined-postback1"
},
{
"type":"text",
"title":"Second",
"postbackText": "dev-defined-postback2"
},
{
"type":"text",
"title":"Third",
"postbackText": "dev-defined-postback3"
}
]
}
{
"type":"quick_reply",
"msgid":"qr1",
"content":{
"type":"image",
"url":"https://www.buildquickbots.com/whatsapp/media/sample/jpg/sample01.jpg",
"text":"this is the body",
"caption":"this is the footer"
},
"options":[
{
"type":"text",
"title":"First",
"postbackText": "dev-defined-postback1"
},
{
"type":"text",
"title":"Second",
"postbackText": "dev-defined-postback2"
},
{
"type":"text",
"title":"Third",
"postbackText": "dev-defined-postback3"
}
]
}
{
"type":"quick_reply",
"msgid":"qr1",
"content":{
"type":"video",
"url":"https://www.buildquickbots.com/whatsapp/media/sample/video/sample01.mp4",
"text":"this is the body",
"caption":"Sample video"
},
"options":[
{
"type":"text",
"title":"First",
"postbackText": "dev-defined-postback1"
},
{
"type":"text",
"title":"Second",
"postbackText": "dev-defined-postback2"
},
{
"type":"text",
"title":"Third",
"postbackText": "dev-defined-postback3"
}
]
}
{
"type":"quick_reply",
"msgid":"qr1",
"content":{
"type":"file",
"url":"https://www.buildquickbots.com/whatsapp/media/sample/pdf/sample01.pdf",
"text":"this is the body",
"filename":"Sample file",
"caption":"this is the footer"
},
"options":[
{
"type":"text",
"title":"First",
"postbackText": "dev-defined-postback1"
},
{
"type":"text",
"title":"Second",
"postbackText": "dev-defined-postback2"
},
{
"type":"text",
"title":"Third",
"postbackText": "dev-defined-postback3"
}
]
}
Key | Type | Description | Note |
---|---|---|---|
| string | Optional | |
| array | ||
| array | Up to 3 options are supported. |
content
array description
content
array descriptionKey | Type | Description | Note |
---|---|---|---|
| string | The type of quick reply message. | Supported types: |
| string | Optional |
Maximum characters: 20 |
| string | Public URL of the media file. |
|
| string | It is the body of the message. | |
| string | Name of the file. |
|
| string | Optional | Maximum characters: 60 |
options
array description
options
array descriptionKey | Type | Description | Note |
---|---|---|---|
| string | The type of the button. | Only text type is supported. |
| string | The title of the button. | It cannot be an empty string and it must be unique within the message. Maximum characters: 20. Does not allow emojis or markdown. |
| string | Developer-defined payload that will be returned when the button is clicked in addition to the display text on the button. |
Location message
{
"type":"location",
"longitude":72.877655,
"latitude":19.075983,
"name":"Mumbai",
"address":"Mumbai, Maharashtra"
}
Contact message
{
"type":"contact",
"contact":{
"addresses":[
{
"city":"Menlo Park",
"country":"United States",
"countryCode":"us",
"state":"CA",
"street":"1 Hacker Way",
"type":"HOME",
"zip":"94025"
},
{
"city":"Menlo Park",
"country":"United States",
"countryCode":"us",
"state":"CA",
"street":"200 Jefferson Dr",
"type":"WORK",
"zip":"94025"
}
],
"birthday":"1995-08-18",
"emails":[
{
"email":"[email protected]",
"type":"Personal"
},
{
"email":"[email protected]",
"type":"Work"
}
],
"name":{
"firstName":"John",
"formattedName":"John Wick",
"lastName":"Wick"
},
"org":{
"company":"Guspshup",
"department":"Product",
"title":"Manager"
},
"phones":[
{
"phone":"+1 (940) 555-1234",
"type":"HOME"
},
{
"phone":"+1 (650) 555-1234",
"type":"WORK",
"wa_id":"16505551234"
}
],
"urls":[
{
"url":"https://www.gupshup.io",
"type":"WORK"
}
]
}
}
Supported Content-Types
Type | Supported Content-Types | Size limit | Note |
---|---|---|---|
text | Text content for the message. | Maximum characters supported: 4096. |
|
image |
| Maximum file size: 5 MB | WhatsApp vertically crops images with the 1:91:1 aspect ratio: 800×418 pixels. To communicate effectively, design the image such that the crux information is at the center of the image. |
file | Any valid MIME-type | Maximum file size: 100 MB | |
audio |
| Maximum file size: 16 MB | The base audio/ogg type is not supported. |
video |
| Maximum file size: 16 MB | Only H.264 video codec and AAC audio codec is supported. |
sticker |
| Maximum file size: 100 KB |
|