POST
Send Location
Send a static location pin or a live location. Use type location for a pin, or type live_location. Requires the Message templates plan feature.
API endpoint
https://waclient.com/api/sendExample:
curl -X POST \
'https://waclient.com/api/send' \
-H 'Content-Type: application/json' \
--data '{
"number": "20100981XXXX",
"type": "location",
"message": {
"name": "Cairo Downtown",
"degreesLatitude": 30.0594999999999998863131622783839702606201171875,
"degreesLongitude": 31.2229999999999989768184605054557323455810546875
},
"instance_id": "6A4B02A1XXXX",
"access_token": "EMCUH3NQQK8YXXXX"
}'Example:
curl -X POST \
'https://waclient.com/api/send' \
-H 'Content-Type: application/json' \
--data '{
"number": "20100981XXXX",
"type": "live_location",
"message": {
"name": "Live",
"degreesLatitude": 30.0594999999999998863131622783839702606201171875,
"degreesLongitude": 31.2229999999999989768184605054557323455810546875,
"live": true
},
"instance_id": "6A4B02A1XXXX",
"access_token": "EMCUH3NQQK8YXXXX"
}'Response
{
"status": "success",
"message": "Success",
"message_payload": {
"key": {
"remoteJid": "[email protected]",
"fromMe": true,
"id": "ABC123"
},
"status": "PENDING"
}
}| Parameter | Description |
|---|---|
| number / chat_id | Recipient phone number (e.g. 20100981XXXX) or chat_id (group: [email protected], channel: xxxx@newsletter) |
| type | location or live_location |
| message / template | JSON: degreesLatitude, degreesLongitude, name — add live: true for live location |
| instance_id | Your instance ID |
| access_token | Your access token |