---
agentTools:
  projectIndex: https://rampwin-api.readme.io/llms.txt
---

# Send WhatsApp Location Message

Sends a WhatsApp location request message, prompting the user to share their live location.

## Endpoint

`POST /api/messages/send`

**Base URL**

```bash URL
https://api.rampwin.com
```

***

## Description

This API allows you to send a **location request interactive message**, which enables users to quickly share their location from WhatsApp.

***

## When to Use

Use this API when you want to:

* Ask user for delivery location
* Capture user’s current location
* Enable location-based services

***

## Authentication

* API Key

***

## Query Parameters

| Parameter          | Type    | Required | Description                                  |
| ------------------ | ------- | -------- | -------------------------------------------- |
| dontShowInChatList | boolean | No       | Hide message from chat list (default: false) |

***

## Headers

| Header       | Type   | Required | Description          |
| ------------ | ------ | -------- | -------------------- |
| X-API-Key    | string | Yes      | Your Rampwin API key |
| Content-Type | string | Yes      | application/json     |

***

## Request Body

```json JSON
{
  "channel_id": "CHANNEL_ID",
  "phone_number": "919999999999",
  "hide_from_chat": false,
  "interactive": {
    "type": "location_request_message",
    "body": {
      "text": "Hello how"
    },
    "action": {
      "name": "send_location"
    }
  }
}
```

***

## Request Parameters

| Field            | Type    | Required | Description                                |
| ---------------- | ------- | -------- | ------------------------------------------ |
| channel\_id      | string  | Yes      | WhatsApp channel ID                        |
| phone\_number    | string  | Yes      | Recipient phone number (with country code) |
| hide\_from\_chat | boolean | No       | Hide message in chat UI                    |
| interactive      | object  | Yes      | Location request object                    |

***

## Example Request

```curl cURL
curl --location 'https://api.rampwin.com/api/messages/send?dontShowInChatList=false' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "channel_id": "YOUR_CHANNEL_ID",
  "phone_number": "919999999999",
  "hide_from_chat": false,
  "interactive": {
    "type": "location_request_message",
    "body": {
      "text": "Please share your location"
    },
    "action": {
      "name": "send_location"
    }
  }
}'
```

***

## Response

### Success (200)

```json JSON
{
  "success": true,
  "message": "Location request message sent successfully"
}
```

***

### Error (400)

```json JSON
{
  "success": false,
  "message": "Invalid location request payload"
}
```

***

## Common Errors

| Error                    | Description             |
| ------------------------ | ----------------------- |
| Invalid interactive type | Incorrect type provided |
| Missing body text        | Message text required   |
| Unauthorized             | Invalid API key         |