The Twilio API for WhatsApp supports sending and receiving GPS location data in messages to WhatsApp users. This guide explains how it's done.
Send location data
You can send a location in a Session message by including the
PersistentAction parameter in your API requests. In these location messages, the message body will be used as the name of the location. You can also include an optional label. Here are usage examples:
|Send location w/label||
For full details and code samples, see Location Messages with WhatsApp (Twilio Docs).
Notice: Location sending is currently only supported in Session Messages. Location cannot be included on a Template message.
Receive location data
End users can also send a location message to your Twilio WhatsApp number. This data will be included in the HTTP POST request for the incoming message that we send to your webhook.
The following additional parameters are added to incoming location messages:
Notice: Location data from messages is not visible in Console at this time.