
curl 'https://graph.facebook.com/<API_VERSION>/<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-d '
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "<WHATSAPP_USER_PHONE_NUMBER>",
"type": "text",
"text": {
"preview_url": <ENABLE_LINK_PREVIEW>,
"body": "<BODY_TEXT>"
}
}'
| Espaço reservado | Descrição | Valor de exemplo |
|---|---|---|
<ACCESS_TOKEN>String | Obrigatório. | EAAAN6tcBzAUBOZC82CW7iR2LiaZBwUHS4Y7FDtQxRUPy1PHZClDGZBZCgWdrTisgMjpFKiZAi1FBBQNO2IqZBAzdZAA16lmUs0XgRcCf6z1LLxQCgLXDEpg80d41UZBt1FKJZCqJFcTYXJvSMeHLvOdZwFyZBrV9ZPHZASSqxDZBUZASyFdzjiy2A1sippEsF4DVV5W2IlkOSr2LrMLuYoNMYBy8xQczzOKDOMccqHEZD |
<API_VERSION>String | Opcional. Versão da Graph API. | v25.0 |
<BODY_TEXT>String | Obrigatório. Corpo de texto. Os URLs são inseridos automaticamente como hiperlinks. Tamanho máximo de 4.096 caracteres. | As requested, here's the link to our latest product: https://www.meta.com/quest/quest-3/ |
<ENABLE_LINK_PREVIEW>Booliano | Opcional. Defina como true para que o cliente do WhatsApp tente renderizar uma prévia de link de qualquer URL na string de texto do corpo.Consulte Prévia do link abaixo. | true |
<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>String | Obrigatório. Identificação do número de telefone do WhatsApp Business. | 106540352242922 |
<WHATSAPP_USER_PHONE_NUMBER>String | Obrigatório. Número de telefone do usuário do WhatsApp. | +16505551234 |
http:// ou https://. Se vários URLs estiverem na string de texto do corpo, apenas o primeiro será renderizado.curl 'https://graph.facebook.com/v25.0/106540352242922/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "+16505551234",
"type": "text",
"text": {
"preview_url": true,
"body": "As requested, here'\''s the link to our latest product: https://www.meta.com/quest/quest-3/"
}
}'
{ "messaging_product": "whatsapp", "contacts": [ { "input": "+16505551234", "wa_id": "16505551234" } ], "messages": [ { "id": "wamid.HBgLMTY0NjcwNDM1OTUVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA" } ] }