# 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>   |
