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

  • An image can optionally be included in the 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",
],
"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
templateIdstringRequiredThe WhatsApp template identifier
componentsBikTemplateComponentsRequiredThe template component configuration

BikTemplateComponents type

NameTypeRequired/OptionalDescription
headerBikTemplateHeader[]OptionalArray of header components
bodystring[]OptionalArray of body variable values
buttonBikTemplateButton[]OptionalArray of button components
limited_time_offerBikTemplateButton[]OptionalLimited-time offer component

BikTemplateHeader type

NameTypeRequired/OptionalDescription
typestringRequiredThe header content type: image, video, document, or text
datastringRequiredThe header value (text string or media URL)
fileNamestringOptionalFile name (applicable only for the document type)

BikTemplateButton type

NameTypeRequired/OptionalDescription
typestringRequiredThe button type: URL, MPM, copy_code, catalog, or limited_time_offer
indexintRequiredZero-based index of the button
datastringRequiredThe button value (text string or URL)

Do not include a Button object if the button type is MPM.

BikCarouselMessagePayload type

NameTypeRequired/OptionalDescription
templateIdstringRequiredThe WhatsApp template identifier
componentsBikCarouselComponentsRequiredThe carousel component configuration

BikCarouselComponents type

NameTypeRequired/OptionalDescription
bodystring[]RequiredArray of body variable values for the carousel header
carouselBikTemplateComponents[]RequiredArray of carousel card components