Enviar texto em uma conversa da caixa de entrada
curl --request POST \
--url https://cloud.watahub.dev/v1/conversations/{conversationId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: '<string>'})
};
fetch('https://cloud.watahub.dev/v1/conversations/{conversationId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://cloud.watahub.dev/v1/conversations/{conversationId}/messages"
payload = { "text": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"messageId": "<string>",
"recipient": "<string>",
"phoneNumberId": "<string>"
}{
"error": "<string>",
"fields": [
"<string>"
],
"requestId": "<string>"
}{
"error": "<string>",
"fields": [
"<string>"
],
"requestId": "<string>"
}Referência da API
Enviar texto em uma conversa da caixa de entrada
Enviar texto em uma conversa da caixa de entrada
POST
/
v1
/
conversations
/
{conversationId}
/
messages
Enviar texto em uma conversa da caixa de entrada
curl --request POST \
--url https://cloud.watahub.dev/v1/conversations/{conversationId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: '<string>'})
};
fetch('https://cloud.watahub.dev/v1/conversations/{conversationId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://cloud.watahub.dev/v1/conversations/{conversationId}/messages"
payload = { "text": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"messageId": "<string>",
"recipient": "<string>",
"phoneNumberId": "<string>"
}{
"error": "<string>",
"fields": [
"<string>"
],
"requestId": "<string>"
}{
"error": "<string>",
"fields": [
"<string>"
],
"requestId": "<string>"
}Autorizações
bearerApiKeyheaderApiKey
Chave de API da conta.
Parâmetros de caminho
phoneNumberId:wa_id, com dois-pontos literais.
Corpo
application/json
Required string length:
1 - 4096Resposta
A Meta aceitou a mensagem.
Esta página foi útil?