# Solicitar localização

`POST /send/location-button`

Pasta: **Enviar Mensagem**

## Autenticação

```http
token: {{token}}
```

## Descrição

# Solicitar localização

Envia uma mensagem interativa pedindo que o usuário compartilhe a localização (botão nativo `send_location`).

## Endpoint

```http
POST {{baseUrl}}/send/location-button
```

## Autenticação

Envie o token da instância no header:

```http
token: {{token}}
```

## Corpo da requisição

| Campo | Tipo | Obrigatório | Descrição |
| --- | --- | --- | --- |
| number | string | Sim* | Destinatário |
| chatid | string | Sim* | Alternativa a number |
| text | string | Sim* | Texto do pedido |
| title | string | Sim* | Alias de text |
| footer | string | Não | Rodapé |
| buttonText | string | Não | Texto do botão (padrão: Compartilhar localização) |

## Exemplo de Requisição

```bash
curl -X POST "{{baseUrl}}/send/location-button" \
  -H "token: {{token}}" \
  -H "Content-Type: application/json" \
  -d '{"number": "{{remoteJid}}", "text": "Por favor, compartilhe sua localização", "buttonText": "Compartilhar localização", "footer": "GoZAP"}'
```

## Resposta de Sucesso

```json
{
  "success": true,
  "message": {
    "id": "3EB0A1B2C3D4E5F6",
    "timestamp": "2026-07-17T12:34:56Z",
    "sender": "5511888888888@s.whatsapp.net"
  }
}
```

## Erros comuns

- `text is required`
- Cooldown interativo
- Instância desconectada

## Corpo (exemplo)

```json
{
  "number": "{{remoteJid}}",
  "text": "Por favor, compartilhe sua localização",
  "buttonText": "Compartilhar localização",
  "footer": "GoZAP"
}
```

## cURL

```bash
curl -X POST "{{baseUrl}}/send/location-button" \
  -H "token: {{token}}" \
  -H "Content-Type: application/json" \
  -d '{
  "number": "{{remoteJid}}",
  "text": "Por favor, compartilhe sua localização",
  "buttonText": "Compartilhar localização",
  "footer": "GoZAP"
}'
```

---

[Índice da pasta](./index.md) · [Índice geral](../index.md) · [UI](https://gozap.dev/docs?op=enviar-mensagem/solicitar-localizacao)
