WhatsApp

Notas
Nível de especialista
A chave API deve ser enviada como um token de portador no cabeçalho de autorização da solicitação. Obtenha sua chave API.
Send message

Ponto de extremidade da API:

POST
https://yours.com.br/api/v1/whatsapp/messages

Text message request example:

curl --location --request POST 'https://yours.com.br/api/v1/whatsapp/messages' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--data '{
  "to": "5511999999999",
  "message": "Sua inscricao foi confirmada.",
  "preview_url": false
}'

Template message request example:

curl --location --request POST 'https://yours.com.br/api/v1/whatsapp/messages' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--data '{
  "to": "5511999999999",
  "template_name": "order_update",
  "language": "pt_BR",
  "components": [
    {
      "type": "body",
      "parameters": [
        { "type": "text", "text": "Maicon" },
        { "type": "text", "text": "12345" }
      ]
    }
  ]
}'
Parâmetro
Tipo
Descrição
to
obrigatório string
The WhatsApp recipient phone number or supported WhatsApp identifier.
message
opcional string
Required when template_name is not provided.
template_name
opcional string
Required when message is not provided.
language
opcional string
Required when sending a template message, for example pt_BR.
components
opcional array
Template components in the format expected by the WhatsApp Cloud API.
preview_url
opcional boolean
Whether WhatsApp should render URL previews for text messages.
Message templates must be approved in Meta before they can be sent. Use templates for proactive messages outside WhatsApp's customer service window.