Skip to main content

Send template message

  • Navigate to the BIK dashboard and locate the template ID in the Templates section. If you cannot find it, contact your account manager.

Template id

  • The following six common template message types are supported:

  • Advanced template types (e.g., QRBs, List, Cart) can be triggered through the Flow API.

Request parameters

NameTypeRequired/OptionalDescription
mediumstringRequiredThe delivery channel for the message (currently only whatsapp is supported)
contactIdentifierstringRequiredThe recipient's phone number
typestringRequiredThe template type: CAROUSEL or DEFAULT
businessPhoneNumberstringOptionalThe business phone number from which the message is sent
payloadBikTemplateMessagePayload or BikCarouselMessagePayloadRequiredThe template message payload object. Refer to the type definitions for BikTemplateMessagePayload, BikCarouselMessagePayload.
callbackDatastringOptionalV2 only. Stringified JSON (max 1024 characters) for passing metadata (e.g. order ID, campaign name). Must be valid, parseable JSON. This value is echoed back in status-update and link-click webhooks.

Callback data (callbackData) — V2 only

callbackData is supported only in the Send Template Message V2 API. It is not available in the deprecated V1 API.

Use callbackData to attach metadata to the message that will be returned in delivery/status and link-click webhooks (e.g. for order mapping, campaign attribution, or analytics).

  • Format: A string containing valid JSON (e.g. JSON.stringify({ "order_id": "ORD123", "campaign": "summer_sale" })).
  • Validation: Must be a non-empty string, parseable as JSON, and must not exceed 1024 characters. If validation fails, the request returns 400 with an error message.

Request Information

CategoryValue
Http requestPOST
URLhttps://bikapi.bikayi.app/integrations/bikPlatformFunctions-messages/v2/sendTemplateMessage

Sample request

curl --location 'https://bikapi.bikayi.app/integrations/bikPlatformFunctions-messages/v2/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"
}
]
}
},
"callbackData": "{\"order_id\":\"ORD123\",\"campaign\":\"summer_sale\"}"
}'

JSON response example:

{
"status": 200,
"success": true,
"data": {
"id": "wamid.HBgMOTE5OTM4NDM4MTM4FQIAERgSMTJCRTg3M0MxREUyNkURatyAA=="
}
}

Response parameters

NameTypeDescription
statusnumberHTTP status code
successbooleanIndicates whether the request succeeded
dataResponseContains the message ID

Errors

Error CodeMeaning
400Invalid payload -- Your request is invalid.
401Unauthorized -- User is not authenticated.
404Not Found -- The specified API could not be found.
407Invalid template -- Invalid whatsapp template id.
500Internal Server Error -- We had a problem with our server. Try again later.

Error response example:

{
"status": 407,
"error": "Invalid whatsapp template id"
}

The individual sections of the WhatsApp template conform to the WhatsApp message payload schema. For details, refer to the official documentation here.