Skip to main content

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.

Template id

  • There are six types of common template messages

  • There are some advanced templates as well (example one with QRBs / List / Cart), those messages can be triggered via the flow API.

Request parameters

NameTypeRequired/OptionalDescription
mediumstringRequiredMessages will be send through this medium( whatsapp for now )
contactIdentifierstringRequiredPhone number of user
typestringRequiredMessage type( CAROUSEL, DEFAULT)
businessPhoneNumberstringOptionalBusiness phone number from which you want to send the message
payloadBikTemplateMessagePayload or BikCarouselMessagePayloadRequiredTemplate message object type. Check the BikTemplateMessagePayload, BikCarouselMessagePayload type here.
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
statusnumberResponse status
successbooleanIs successful response or not
dataResponseMessage ID in the response

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 WhatsApp match the schema of the WhatsApp message payload. You can find out details about message payload here