logo
enes

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) and type (details)
  • type values 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:

NameDescriptionTypeRequirements
send_location_requestObject for asking the user to share their location.ObjectRequired if you're sending a location request.

Send location request object

NameDescriptionTypeRequirements
bodyMessage text that accompanies the request for the user to share their location.StringRequired.
action.nameMust be "send_location".StringOptional.

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"
}
}
}


Previous
WhatsApp Flows
Next
Call button (voice call)