curl --request POST \
--url https://api.wegly.com.br/integrations/external/chats/{id}/messages/interactive \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"interactive_type": "button",
"action": {
"buttons": [
{
"id": "<string>",
"title": "<string>"
}
],
"button": "<string>",
"sections": [
{
"rows": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>"
}
],
"title": "<string>"
}
]
},
"body": {
"text": "<string>"
},
"reference_wamid": "<string>"
}
'import requests
url = "https://api.wegly.com.br/integrations/external/chats/{id}/messages/interactive"
payload = {
"interactive_type": "button",
"action": {
"buttons": [
{
"id": "<string>",
"title": "<string>"
}
],
"button": "<string>",
"sections": [
{
"rows": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>"
}
],
"title": "<string>"
}
]
},
"body": { "text": "<string>" },
"reference_wamid": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
interactive_type: 'button',
action: {
buttons: [{id: '<string>', title: '<string>'}],
button: '<string>',
sections: [
{
rows: [{id: '<string>', title: '<string>', description: '<string>'}],
title: '<string>'
}
]
},
body: JSON.stringify({text: '<string>'}),
reference_wamid: '<string>'
})
};
fetch('https://api.wegly.com.br/integrations/external/chats/{id}/messages/interactive', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wegly.com.br/integrations/external/chats/{id}/messages/interactive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'interactive_type' => 'button',
'action' => [
'buttons' => [
[
'id' => '<string>',
'title' => '<string>'
]
],
'button' => '<string>',
'sections' => [
[
'rows' => [
[
'id' => '<string>',
'title' => '<string>',
'description' => '<string>'
]
],
'title' => '<string>'
]
]
],
'body' => [
'text' => '<string>'
],
'reference_wamid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wegly.com.br/integrations/external/chats/{id}/messages/interactive"
payload := strings.NewReader("{\n \"interactive_type\": \"button\",\n \"action\": {\n \"buttons\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"button\": \"<string>\",\n \"sections\": [\n {\n \"rows\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"title\": \"<string>\"\n }\n ]\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"reference_wamid\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wegly.com.br/integrations/external/chats/{id}/messages/interactive")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"interactive_type\": \"button\",\n \"action\": {\n \"buttons\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"button\": \"<string>\",\n \"sections\": [\n {\n \"rows\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"title\": \"<string>\"\n }\n ]\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"reference_wamid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wegly.com.br/integrations/external/chats/{id}/messages/interactive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"interactive_type\": \"button\",\n \"action\": {\n \"buttons\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"button\": \"<string>\",\n \"sections\": [\n {\n \"rows\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"title\": \"<string>\"\n }\n ]\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"reference_wamid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"total": 123,
"records": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "text",
"origin": "INBOUND",
"from_me": true,
"sent_via": "CONTACT",
"status": "processing",
"body_text": "<string>",
"meta_timestamp": "2023-11-07T05:31:56Z",
"transcription": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"media": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mime_type": "<string>",
"file_name": "<string>",
"is_downloaded": true,
"url": "<string>"
},
"call": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "RINGING",
"direction": "INBOUND",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"duration_ms": 123,
"recording_processed": true,
"recording_available": true,
"has_recording": true
},
"content_payload": {},
"reactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"emoji": "<string>",
"actor": "CONTACT",
"reactor_wa_id": "<string>",
"reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}
],
"is_history": true,
"history_phase": 123,
"history_chunk_order": 123,
"history_progress": 123,
"is_media_placeholder": true,
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
},
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"is_forwarded": true,
"error_code": 123,
"error_message": "<string>",
"quoted_message": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "text",
"origin": "INBOUND",
"status": "processing",
"page": 123,
"from_me": true,
"sent_via": "CONTACT",
"body_text": "<string>",
"content_payload": {},
"reactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"emoji": "<string>",
"actor": "CONTACT",
"reactor_wa_id": "<string>",
"reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}
],
"meta_timestamp": "2023-11-07T05:31:56Z",
"is_history": true,
"history_phase": 123,
"history_chunk_order": 123,
"history_progress": 123,
"is_media_placeholder": true,
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
},
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"transcription": "<string>",
"is_forwarded": true,
"error_code": 123,
"error_message": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"media": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mime_type": "<string>",
"file_name": "<string>",
"is_downloaded": true,
"url": "<string>"
},
"whatsapp_ai_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"whatsapp_ai_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}Enviar mensagem interativa
WhatsApp: botões ou lista, dentro da janela de atendimento. IDs de opções devem ser únicos. button exige 1 a 3 buttons; list exige button e sections com até 10 linhas no total. Permissão da chave: crm/chats.write. O acesso também respeita a empresa e as permissões do usuário criador da chave.
curl --request POST \
--url https://api.wegly.com.br/integrations/external/chats/{id}/messages/interactive \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"interactive_type": "button",
"action": {
"buttons": [
{
"id": "<string>",
"title": "<string>"
}
],
"button": "<string>",
"sections": [
{
"rows": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>"
}
],
"title": "<string>"
}
]
},
"body": {
"text": "<string>"
},
"reference_wamid": "<string>"
}
'import requests
url = "https://api.wegly.com.br/integrations/external/chats/{id}/messages/interactive"
payload = {
"interactive_type": "button",
"action": {
"buttons": [
{
"id": "<string>",
"title": "<string>"
}
],
"button": "<string>",
"sections": [
{
"rows": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>"
}
],
"title": "<string>"
}
]
},
"body": { "text": "<string>" },
"reference_wamid": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
interactive_type: 'button',
action: {
buttons: [{id: '<string>', title: '<string>'}],
button: '<string>',
sections: [
{
rows: [{id: '<string>', title: '<string>', description: '<string>'}],
title: '<string>'
}
]
},
body: JSON.stringify({text: '<string>'}),
reference_wamid: '<string>'
})
};
fetch('https://api.wegly.com.br/integrations/external/chats/{id}/messages/interactive', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wegly.com.br/integrations/external/chats/{id}/messages/interactive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'interactive_type' => 'button',
'action' => [
'buttons' => [
[
'id' => '<string>',
'title' => '<string>'
]
],
'button' => '<string>',
'sections' => [
[
'rows' => [
[
'id' => '<string>',
'title' => '<string>',
'description' => '<string>'
]
],
'title' => '<string>'
]
]
],
'body' => [
'text' => '<string>'
],
'reference_wamid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wegly.com.br/integrations/external/chats/{id}/messages/interactive"
payload := strings.NewReader("{\n \"interactive_type\": \"button\",\n \"action\": {\n \"buttons\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"button\": \"<string>\",\n \"sections\": [\n {\n \"rows\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"title\": \"<string>\"\n }\n ]\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"reference_wamid\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wegly.com.br/integrations/external/chats/{id}/messages/interactive")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"interactive_type\": \"button\",\n \"action\": {\n \"buttons\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"button\": \"<string>\",\n \"sections\": [\n {\n \"rows\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"title\": \"<string>\"\n }\n ]\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"reference_wamid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wegly.com.br/integrations/external/chats/{id}/messages/interactive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"interactive_type\": \"button\",\n \"action\": {\n \"buttons\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"button\": \"<string>\",\n \"sections\": [\n {\n \"rows\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"title\": \"<string>\"\n }\n ]\n },\n \"body\": {\n \"text\": \"<string>\"\n },\n \"reference_wamid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"total": 123,
"records": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "text",
"origin": "INBOUND",
"from_me": true,
"sent_via": "CONTACT",
"status": "processing",
"body_text": "<string>",
"meta_timestamp": "2023-11-07T05:31:56Z",
"transcription": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"media": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mime_type": "<string>",
"file_name": "<string>",
"is_downloaded": true,
"url": "<string>"
},
"call": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "RINGING",
"direction": "INBOUND",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"duration_ms": 123,
"recording_processed": true,
"recording_available": true,
"has_recording": true
},
"content_payload": {},
"reactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"emoji": "<string>",
"actor": "CONTACT",
"reactor_wa_id": "<string>",
"reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}
],
"is_history": true,
"history_phase": 123,
"history_chunk_order": 123,
"history_progress": 123,
"is_media_placeholder": true,
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
},
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"is_forwarded": true,
"error_code": 123,
"error_message": "<string>",
"quoted_message": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "text",
"origin": "INBOUND",
"status": "processing",
"page": 123,
"from_me": true,
"sent_via": "CONTACT",
"body_text": "<string>",
"content_payload": {},
"reactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"emoji": "<string>",
"actor": "CONTACT",
"reactor_wa_id": "<string>",
"reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}
],
"meta_timestamp": "2023-11-07T05:31:56Z",
"is_history": true,
"history_phase": 123,
"history_chunk_order": 123,
"history_progress": 123,
"is_media_placeholder": true,
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
},
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"transcription": "<string>",
"is_forwarded": true,
"error_code": 123,
"error_message": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"media": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mime_type": "<string>",
"file_name": "<string>",
"is_downloaded": true,
"url": "<string>"
},
"whatsapp_ai_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"whatsapp_ai_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}Authorizations
Chave de integração com prefixo wegly_, enviada em Authorization: Bearer . Não é JWT. A chave deve estar ativa, não excluída e dentro da validade. Com allowed_domain, Origin (ou Referer na ausência de Origin) precisa informar o hostname permitido. A empresa e as permissões são obtidas pela chave.
Path Parameters
UUID da conversa.
Body
- Option 1
- Option 2
button button exige buttons e não aceita button/sections; list exige button e sections e não aceita buttons. São permitidas até 10 linhas no total da lista, com IDs únicos.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
200