Location

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 'message={"type":"location","location":{"latitude":"37.483307","longitude":"122.148981","name":"Pablo Morales","address":"1 Hacker Way, Menlo Park, CA 94025"}}' \
--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
messageobjectYesContains location detailsSee 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", "hello"]

message object structure:

FieldTypeDescriptionExample
typestringType of messagelocation
locationobjectLocation object containing details like longitude, latitude, address, nameSee below for detailed structure
location object structure:
FieldTypeDescriptionExample
longitudestringLongitude of location-79.0896492
latitudestringLatitude of location42.5950661
namestringText that will appear below the mapMiles Morales
addressstringAddress of location that will appear below the mapNew York 10019

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 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!