Payload examples for send template message
Sending a message with only text
Sample Payload :
{
"medium": "whatsapp",
"contactIdentifier": "+919900900900",
"payload": {
"templateId": "2iUKSaBPsoer1rUE33aW",
"components": {
"body": [
"USER_NAME", "565656"
]
}
}
}
Sending a message with only image + text
{
"contactIdentifier": "+919999999999",
"medium": "whatsapp",
"payload": {
"templateId": "hHflM320sgf6VANSF1Ow",
"components": {
"header": [
{
"type": "image",
"data": "https://firebasestorage.googleapis.com/v0/b/staging-bikayi.appspot.com/o/bik%2FOeeDDiiwGDXkoAWs2hroxSgY2ny1%2FScreenshot%202022-10-17%20at%205.04.52%20PM.png?alt=media&token=9db86f1d-6cf5-4886-8051-760876e52cff"
}
],
"body": [
"variable1",
"variable2",
]
}
}
}
Sending a message with text + CTA
- You can also optionally add an image to the message
{
"contactIdentifier": "+919999999999",
"medium": "whatsapp",
"payload": {
"templateId": "hHflM320sgf6VANSF1Ow",
"components": {
"header": [
{
"type": "image",
"data": "https://firebasestorage.googleapis.com/v0/b/staging-bikayi.appspot.com/o/bik%2FOeeDDiiwGDXkoAWs2hroxSgY2ny1%2FScreenshot%202022-10-17%20at%205.04.52%20PM.png?alt=media&token=9db86f1d-6cf5-4886-8051-760876e52cff"
}
],
"body": [
"variable1",
"variable2",
],
"button": [
{
"type": "URL",
"index": 0,
"data": "https://www.bik.ai"
}
]
}
}
}
Sending a message with carousel
{
"contactIdentifier": "+919999999999",
"medium": "whatsapp",
"type": "CAROUSEL",
"payload": {
"templateId": "TEMPLATE_ID",
"components": {
"body": "Test message.",
"carousel": [
{
"header": [
{
"type": "image",
"data": "https://firebasestorage.googleapis.com/v0/b/staging-bikayi.appspot.com/o/bik%2FOeeDDiiwGDXkoAWs2hroxSgY2ny1%2FScreenshot%202022-10-17%20at%205.04.52%20PM.png?alt=media&token=9db86f1d-6cf5-4886-8051-760876e52cff"
}
],
"body": [
"variable1",
"variable2",
],
"button": [
{
"type": "URL",
"index": 0,
"data": "https://www.bik.ai"
}
]
},
{
"header": [
{
"type": "image",
"data": "https://firebasestorage.googleapis.com/v0/b/staging-bikayi.appspot.com/o/bik%2FOeeDDiiwGDXkoAWs2hroxSgY2ny1%2FScreenshot%202022-10-17%20at%205.04.52%20PM.png?alt=media&token=9db86f1d-6cf5-4886-8051-760876e52cff"
}
],
"body": [
"variable3",
"variable4",
],
"button": [
{
"type": "URL",
"index": 0,
"data": "https://www.bik2.ai"
}
]
}
]
}
}
}
Sending a message with copy code
{
"contactIdentifier": "+919999999999",
"medium": "whatsapp",
"type": "DEFAULT",
"payload": {
"templateId": "TEMPLATE_ID",
"components": {
"header": [
{
"type": "image",
"data": "https://firebasestorage.googleapis.com/v0/b/staging-bikayi.appspot.com/o/bik%2FOeeDDiiwGDXkoAWs2hroxSgY2ny1%2FScreenshot%202022-10-17%20at%205.04.52%20PM.png?alt=media&token=9db86f1d-6cf5-4886-8051-760876e52cff"
}
],
"body": [
"variable1",
"variable2",
],
"button": [
{
"type": "URL",
"index": 0,
"data": "https://www.bik.ai"
},
{
"type": "copy_code",
"index": 1,
"data": "test data"
}
]
}
}
}
Sending a message with LTO
{
"contactIdentifier": "+919999999999",
"medium": "whatsapp",
"type": "DEFAULT",
"payload": {
"templateId": "TEMPLATE_ID",
"components": {
"header": [
{
"type": "image",
"data": "https://firebasestorage.googleapis.com/v0/b/staging-bikayi.appspot.com/o/bik%2FOeeDDiiwGDXkoAWs2hroxSgY2ny1%2FScreenshot%202022-10-17%20at%205.04.52%20PM.png?alt=media&token=9db86f1d-6cf5-4886-8051-760876e52cff"
}
],
"limited_time_offer":[
{
"type": "limited_time_offer",
"data": "123456789000"
}
],
"body": [
"variable1",
"variable2",
],
"button": [
{
"type": "URL",
"index": 0,
"data": "https://www.bik.ai"
},
{
"type": "copy_code",
"index": 1,
"data": "test data"
}
]
}
}
}
BikTemplateMessagePayload Type
Name | Type | Required/Optional | Description |
---|---|---|---|
templateId | string | Required | Whatsapp template id |
components | BikTemplateComponents | Required | Components details |
BikTemplateComponents Type
Name | Type | Required/Optional | Description |
---|---|---|---|
header | BikTemplateHeader[] | Optional | List of header |
body | string[] | Optional | List of messages |
button | BikTemplateButton[] | Optional | List of button |
limited_time_offer | BikTemplateButton[] | Optional | Limited time offer buttons |
BikTemplateHeader Type
Name | Type | Required/Optional | Description |
---|---|---|---|
type | string | Required | type(image , video , document , text ) |
data | string | Required | text or url |
BikTemplateButton Type
Name | Type | Required/Optional | Description |
---|---|---|---|
type | string | Required | type(URL , MPM , copy_code , catalog , limited_time_offer ) |
index | int | Required | Button index |
data | string | Required | text or url |
Don't pass Button object if button type is MPM
.
BikCarouselMessagePayload Type
Name | Type | Required/Optional | Description |
---|---|---|---|
templateId | string | Required | Whatsapp template id |
components | BikCarouselComponents | Required | Carousel components details |
BikCarouselComponents Type
Name | Type | Required/Optional | Description |
---|---|---|---|
body | string[] | Required | Carousel header text |
carousel | BikTemplateComponents[] | Required | List of carousel card |