Send template message
- Go to BIK dashboard and in the templates section get the id of the template which you want to send. In case you are not able to find it, you can also ask your account manager.
There are six types of common template messages
- Sending a message with only text
- Sending a message with image + text
- Sending a message with CTAs (url / contact)
- Sending a message with carousel
- Sending a message with copy code
- Sending a message with LTO
There are some advanced templates as well (example one with QRBs / List / Cart), those messages can be triggered via the flow API.
Sending a message with only text
Sample Payload :
{
"medium": "whatsapp",
"appId": "APP_ID",
"contactIdentifier": "+919900900900",
"payload": {
"templateId": "2iUKSaBPsoer1rUE33aW",
"components": {
"body": [
"USER_NAME", "565656"
]
}
}
}
Sending a message with only image + text
{
"appId": "APP_ID",
"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
{
"appId": "APP_ID",
"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
{
"appId": "APP_ID",
"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
{
"appId": "APP_ID",
"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
{
"appId": "APP_ID",
"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"
}
]
}
}
}
API Details
curl --location 'https://bikapi.bikayi.app/integrations/bikPlatformFunctions-sendTemplateMessage' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic AUTH_TOKEN' \
--data '{
"appId": "APP_ID",
"contactIdentifier": "+919900990090,
"medium": "whatsapp",
"payload": {
"templateId": "TEMPLATE_ID",
"components": {
"header": [
{
"type": "image",
"data": "https://testimageurl.com/testimage.png"
}
],
"body": [
"Test"
],
"button": [
{
"type": "URL",
"index": 0,
"data": "https://www.google.com"
}
]
}
}
}'
JSON response example:
{
"status": 200,
"response": {
"id": "MESSAGE_ID"
}
}
Request Information
Category | Value |
---|---|
Http request | POST |
URL | https://bikapi.bikayi.app/integrations/bikPlatformFunctions-sendTemplateMessage |
Input Schema for request
Field | Type | Meaning |
---|---|---|
medium | string* | Messages will be send through this medium |
appId | string* | Application id of the store |
contactIdentifier | string* | Phone number of user |
businessPhoneNumber | string | Business phone number from which you want to send the message |
payload | Template/Carousel message object* | Template/Carousel message Object |
Output Schema for request
Field | Type | Meaning |
---|---|---|
status | number | Message status |
id | string | Message id used for tracking |
The individual sections of WhatsApp match the schema of the WhatsApp message payload. You can find out details about message payload here