Text

cURL

curl --location '{{api_front_base_url}}/wa/api/v1/template/msg' \
--header 'apikey: {{apiKey}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'channel=whatsapp' \
--data-urlencode 'source={{source phone number}}' \
--data-urlencode 'destination={{destination phone number}}' \
--data-urlencode 'src.name={{app_name}}' \
--data-urlencode 'template={"id":"<template_id>","params":[<list_of_template_parameters>]}' \
--data-urlencode 'postbackTexts=[{"index":<qr_btn_index>,"text":"<postback_text>"}]'

Request Parameters

ParameterLocationTypeDescriptionExample
apikeyHeaderstringYour account API key2xxc4x4xx2c94xxxc2f9xx9d43xxxx8a

Form Parameters (Request Body)

ParameterTypeRequiredDescriptionExample
sourcestringYesSender WhatsApp Number919163xxxxx3
src.namestringYesApp name that the source number belongs toDemoApp
destinationstringYesReceiver WhatsApp Number917839xxxxx3
templateobjectYesContains template id and list of template parametersSee below for detailed structure
postbackTextsarrayNoList of objects containing postback text detailsSee below for detailed structure
channelstringNoMessaging Platform Namewhatsapp

template object structure:

FieldTypeDescriptionExample
idstringTemplate IDtemplate_id
paramsarrayList of template parameters["hi"]

postbackTexts object structure:

FieldTypeDescriptionExample
indexintegerButton index (0-based)0
textstringPostback text for the buttonhello

Status Codes

Status CodeDescriptionResponse Body
202Success response{ "messageId": "message id", "status": "success" }
400Error response; in case of a bad request{ "message": "Invalid Destination", "status": "error" }
401Error response; in case of authentication failure{ "message": "Authentication Failed", "status": "error" }
Language
Click Try It! to start a request and see the response here!