Send a location message
Sends a map pin the recipient can open in their maps app. Needs an open 24-hour window.
Example
Section titled “Example”curl -X POST "$HELLO_API_URL/v1/<your-phone-number-id>/messages" \ -H "Authorization: Bearer $HELLO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "to": "+919999999999", "type": "location", "location": { "latitude": 12.9716, "longitude": 77.5946, "name": "Indiranagar store", "address": "100 Feet Rd, Indiranagar, Bengaluru 560038" } }'Response
Section titled “Response”202 Accepted (queued), or 200 with ?sync=true once WhatsApp accepts it. See
Send a message.
Fields
Section titled “Fields”| Field | Type | Required | Description |
|---|---|---|---|
location.latitude |
number | Yes | Latitude in decimal degrees |
location.longitude |
number | Yes | Longitude in decimal degrees |
location.name |
string | No | Place name shown above the address |
location.address |
string | No | Address shown under the name |
In a location message latitude and longitude are numbers. In a template’s
location header they are strings.
To ask the customer to share their location instead, use an interactive location request.
Common errors
Section titled “Common errors”| Status | code |
Cause |
|---|---|---|
403 |
OUTSIDE_24H_WINDOW |
The recipient’s 24-hour window is closed |
400 |
VALIDATION_ERROR |
location is missing or the wrong shape |
422 |
SEND_FAILED |
(?sync=true only) WhatsApp rejected the send |