Skip to main content

Payload examples for send template message

Sending a message with only text

template_body

Sample Payload :

{
"medium": "whatsapp",
"contactIdentifier": "+919900900900",
"payload": {
"templateId": "2iUKSaBPsoer1rUE33aW",
"components": {
"body": [
"USER_NAME", "565656"
]
}
}
}

Sending a message with only image + text

template_header

{
"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

template_button

  • 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"
}
]
}
}
}
{
"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

NameTypeRequired/OptionalDescription
templateIdstringRequiredWhatsapp template id
componentsBikTemplateComponentsRequiredComponents details

BikTemplateComponents Type

NameTypeRequired/OptionalDescription
headerBikTemplateHeader[]OptionalList of header
bodystring[]OptionalList of messages
buttonBikTemplateButton[]OptionalList of button
limited_time_offerBikTemplateButton[]OptionalLimited time offer buttons

BikTemplateHeader Type

NameTypeRequired/OptionalDescription
typestringRequiredtype(image, video, document, text)
datastringRequiredtext or url

BikTemplateButton Type

NameTypeRequired/OptionalDescription
typestringRequiredtype(URL, MPM, copy_code, catalog, limited_time_offer)
indexintRequiredButton index
datastringRequiredtext or url

Don't pass Button object if button type is MPM.

BikCarouselMessagePayload Type

NameTypeRequired/OptionalDescription
templateIdstringRequiredWhatsapp template id
componentsBikCarouselComponentsRequiredCarousel components details

BikCarouselComponents Type

NameTypeRequired/OptionalDescription
bodystring[]RequiredCarousel header text
carouselBikTemplateComponents[]RequiredList of carousel card