Location request
Last update: 6 hours ago by Irais Aguirre
Integration summary
- Endpoint:
POST https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging- Token: messaging token, in the
Authorization: Bearer {{wa-msg-api-token}}header (how to generate it)- Common fields:
from,to(phone number or BSUID) andtype(details)typevalues on this page:"interactive"- Response: the same for every message (see response)
Messages with a button that asks the user to share their location. They are sent with POST /v1/messaging; headers, common fields and the response are in HTTP connection.
Location request
The type field must be "interactive" and the message content is sent in the send_location_request object. See the general structure of interactive messages.
Body
Fields for Location request:
| Name | Description | Type | Requirements |
|---|---|---|---|
| send_location_request | Object for asking the user to share their location. | Object | Required if you're sending a location request. |
Send location request object
| Name | Description | Type | Requirements |
|---|---|---|---|
| body | Message text that accompanies the request for the user to share their location. | String | Required. |
| action.name | Must be "send_location". | String | Optional. |
Example
Complete Location request example (HTTP request and JSON body):
HTTP request
curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \-H 'Authorization: Bearer {{wa-msg-api-token}}' \-H 'Content-Type: application/json' \-d '{"from": "5215500000001","to": "5215500000002","type": "interactive","send_location_request": {"body": "Please share your location to continue with the service.","action": {"name": "send_location"}}}'
Body
{"from": "5215500000001","to": "5215500000002","type": "interactive","send_location_request": {"body": "Please share your location to continue with the service.","action": {"name": "send_location"}}}
