> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kapso.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Request user location

> Ask users to share their current location via interactive message

Request users to share their current location. Displays a "Send Location" button in WhatsApp.

<CodeGroup>
  ```typescript TypeScript SDK icon="square-js" theme={null}
  import { WhatsAppClient } from '@kapso/whatsapp-cloud-api';

  const client = new WhatsAppClient({
    baseUrl: 'https://api.kapso.ai/meta/whatsapp',
    kapsoApiKey: process.env.KAPSO_API_KEY!
  });

  await client.messages.sendInteractiveLocationRequest({
    phoneNumberId: '647015955153740',
    to: '15551234567',
    bodyText: 'Please share your location so we can provide accurate delivery estimates.',
    parameters: {
      requestMessage: 'Please share your location so we can provide accurate delivery estimates.'
    }
  });
  ```

  ```bash REST API icon="code" theme={null}
  curl -X POST 'https://api.kapso.ai/meta/whatsapp/v24.0/647015955153740/messages' \
    -H 'X-API-Key: YOUR_API_KEY' \
    -H 'Content-Type: application/json' \
    -d '{
      "messaging_product": "whatsapp",
      "to": "15551234567",
      "type": "interactive",
      "interactive": {
        "type": "location_request_message",
        "body": {
          "text": "Please share your location so we can provide accurate delivery estimates."
        },
        "action": {
          "name": "send_location"
        }
      }
    }'
  ```
</CodeGroup>

## Response handling

When the user shares their location, you'll receive a webhook with:

```json theme={null}
{
  "type": "location",
  "location": {
    "latitude": 37.7749,
    "longitude": -122.4194,
    "name": "Optional location name",
    "address": "Optional address"
  }
}
```

## Use cases

* Delivery services requesting drop-off locations
* Store locators finding nearest branches
* Field service appointments
* Event check-ins
