# Location

Location messages allow sending a location’s latitude and longitude coordinates to a WhatsApp user.

### Location Messages Request

<mark style="color:orange;">`POST`</mark> `https://waba-v2.360dialog.io/messages`

Use the messages endpoint to send a location message to a WhatsApp user.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `D360-API-KEY`     |

**Body Example**

```json
{
  "messaging_product": "whatsapp",
  "to": "PHONE_NUMBER",
  "type": "location",
  "location": {
    "longitude": LONG_NUMBER,
    "latitude": LAT_NUMBER,
    "name": LOCATION_NAME,
    "address": LOCATION_ADDRESS
  }
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "contacts": [
    {
      "input": "text",
      "wa_id": "text"
    }
  ],
  "messages": [
    {
      "id": "text",
      "message_status": "accepted"
    }
  ],
  "messaging_product": "text"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}

#### Location Object <a href="#location-object" id="location-object"></a>

| Name        | Description                                                        |
| ----------- | ------------------------------------------------------------------ |
| `longitude` | <p><strong>Required.</strong></p><p>Longitude of the location.</p> |
| `latitude`  | <p><strong>Required.</strong></p><p>Latitude of the location.</p>  |
| `name`      | <p><strong>Required.</strong></p><p>Name of the location.</p>      |
| `address`   | <p><strong>Required.</strong></p><p>Address of the location.</p>   |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.360dialog.com/docs/messaging/message-types/location.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
