POST /v1/conversations/{id}/messages
const url = 'https://seu-endereco-da-api/v1/conversations/example/messages';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"text","text":"example","mediaKey":"example","mediaMime":"example","asVoiceNote":true,"durationMs":1,"waveform":"example","fileName":"example","clientMessageId":"example","replyToId":"example","interactive":{"header":{"kind":"text","text":"example"},"body":"example","footer":"example","buttons":[{"id":"example","text":"example","url":"example"}],"buttonText":"example","sections":[{"title":"example","rows":[{"id":"example","title":"example","description":"example"}]}]},"location":{"latitude":1,"longitude":1,"name":"example","address":"example"},"carousel":{"body":"example","cards":[{"mediaKind":"image","mediaKey":"example","mediaMime":"example","body":"example","linkLabel":"example","url":"example","buttons":[{"id":"example","text":"example"}]}]},"flow":{"flowId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","cta":"example","screen":"example","body":"example","mode":"draft","data":{}},"contactCardId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","mentions":["example"],"viaDefaultTemplate":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://seu-endereco-da-api/v1/conversations/example/messages \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "text", "text": "example", "mediaKey": "example", "mediaMime": "example", "asVoiceNote": true, "durationMs": 1, "waveform": "example", "fileName": "example", "clientMessageId": "example", "replyToId": "example", "interactive": { "header": { "kind": "text", "text": "example" }, "body": "example", "footer": "example", "buttons": [ { "id": "example", "text": "example", "url": "example" } ], "buttonText": "example", "sections": [ { "title": "example", "rows": [ { "id": "example", "title": "example", "description": "example" } ] } ] }, "location": { "latitude": 1, "longitude": 1, "name": "example", "address": "example" }, "carousel": { "body": "example", "cards": [ { "mediaKind": "image", "mediaKey": "example", "mediaMime": "example", "body": "example", "linkLabel": "example", "url": "example", "buttons": [ { "id": "example", "text": "example" } ] } ] }, "flow": { "flowId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "cta": "example", "screen": "example", "body": "example", "mode": "draft", "data": {} }, "contactCardId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "mentions": [ "example" ], "viaDefaultTemplate": true }'Permissão que a Chave de acesso precisa: Enviar mensagem e atender (conversations:write).
Authorizations
Seção intitulada “Authorizations”Parameters
Seção intitulada “Parameters”Path Parameters
Seção intitulada “Path Parameters”Request Bodyrequired
Seção intitulada “Request Bodyrequired”object
object
object
object
object
object
object
object
object
object
object
object
Responses
Seção intitulada “Responses”object
object
object
object
The group member who sent it; null for a private conversation or for a message we sent
The group member who sent it; null for a private conversation or for a message we sent
The group members tagged in the text: each @token in the text is shown as @name; a token with no known member is left as written
object
The digits after @ in the text: the member’s lid or phone
The saved contact name, else the member’s WhatsApp name, else the phone
The channel this message came in or went out through; it can differ from the conversation’s current channel
Still filled in for a channel that was already removed
The channel runs in coexistence with the WhatsApp Business app
The contact identifier this message came in from or went out to; null for a group or for an older message
object
object
object
Formulário enviado (type flow): body, cta e formName
object
The title the provider gave when it refused the message
The charge a payment message asks the contact to pay
Only on a payment message: the template kind and the charge as it is now (status, value, instruments)
object
What the audio says; only for audio messages
Only present for a group conversation
object
Only present for a group conversation
object
Only present for a poll message that has at least one vote
object
Example
{ "source": "manual", "transcriptionStatus": "pending"}