Location Templates
A template approved with a location header needs the place to show each time you send it. Pass that place in the top-level location object.
POST /v1/whatsapp/send| Field | Type | Required | Description |
|---|---|---|---|
location.latitude | number | ✓ | Latitude from -90 to 90 |
location.longitude | number | ✓ | Longitude from -180 to 180 |
location.name | string | ✓ | Name displayed above the address |
location.address | string | ✓ | Address displayed in the location card |
location is separate from variables. It is required only when the selected template has a HEADER component whose format is LOCATION.
Send a location template
cURL
curl -X POST https://api.bahasha.app/v1/whatsapp/send \
-H "Authorization: Bearer bh_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"to": "+254700000000",
"phone_number_id": "123456789",
"template_name": "visit_our_office",
"language_code": "en_US",
"location": {
"latitude": -1.2864,
"longitude": 36.8172,
"name": "My business location",
"address": "Harambee Avenue, Nairobi"
}
}'Validation errors
| Request problem | Result |
|---|---|
Location template without location | 400 location is required when sending a template with a LOCATION header. |
Non-location template with location | 400 location can only be supplied for a template with a LOCATION header. |
| Missing or blank name/address | 400 Bad Request |
| Latitude or longitude outside its valid range | 400 Bad Request |
Use coordinates for the same place described by name and address. WhatsApp uses the coordinates as the actual destination; changing only the text does not move the location.