curl --request GET \
--url https://api.wegly.com.br/integrations/external/chats/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.wegly.com.br/integrations/external/chats/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wegly.com.br/integrations/external/chats/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wegly.com.br/integrations/external/chats/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wegly.com.br/integrations/external/chats/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wegly.com.br/integrations/external/chats/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "OPEN",
"priority": 0,
"phone_number": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_number": "<string>",
"raw_number": "<string>",
"phone_number_id": "<string>"
},
"crm_person": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"birth_date": "2023-11-07T05:31:56Z",
"gender": 123,
"notes": "<string>",
"contacts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": 123,
"value": "<string>",
"primary": true
}
],
"documents": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": 123,
"label": "<string>",
"value": "<string>"
}
],
"address": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": 123,
"type": 123,
"name": "<string>",
"street": "<string>",
"number": "<string>",
"complement": "<string>",
"district": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
}
},
"channel_type": "WHATSAPP",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"participants": [
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
}
],
"whatsapp_flow_sessions": [
{
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"flow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"flow_name": "<string>",
"status": "ACTIVE",
"status_label": "<string>",
"is_active": true,
"started_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"current_step": {
"node_id": "<string>",
"node_key": "<string>",
"name": "<string>",
"status": "<string>",
"status_label": "<string>",
"branch_key": "<string>",
"branch_label": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
}
}
],
"pending_copilot_actions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"execution_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "<string>",
"chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"action_key": "<string>",
"status": "<string>",
"confidence": "<string>",
"requires_review": true,
"input_payload": "<unknown>",
"output_payload": null,
"failure_reason": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"executed_at": "2023-11-07T05:31:56Z"
}
],
"wa_contact_id": "<string>",
"contact_name": "<string>",
"contact_number": "<string>",
"chat_type": "INDIVIDUAL",
"unread_count": 123,
"is_manually_unread": true,
"archived_at": "2023-11-07T05:31:56Z",
"assigned_agent": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
},
"last_message": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "text",
"origin": "INBOUND",
"from_me": true,
"sent_via": "CONTACT",
"status": "processing",
"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>"
},
"crm_marketing_lead_source": [
{}
],
"transcription": "<string>",
"is_forwarded": true,
"whatsapp_ai_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"last_customer_msg_at": "2023-11-07T05:31:56Z",
"session_expires_at": "2023-11-07T05:31:56Z",
"can_send_open_message": true,
"has_pending_copilot_actions": true,
"pending_copilot_actions_count": 123,
"channel_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"display_name": "<string>",
"provider_status": "<string>"
},
"external_contact": {
"id": "<string>",
"handle": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
},
"legacy": {
"whatsapp_chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"whatsapp_phone_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"wa_contact_id": "<string>"
},
"remote_profile_name": "<string>",
"crm_marketing_lead_source": [
{}
],
"assignable_agents": [
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
}
]
}Consultar detalhes do chat
Consulta WhatsApp ou Instagram. A estrutura de mídia e os metadados de canal variam conforme channel_type. Permissão da chave: crm/chats.read. O acesso também respeita a empresa e as permissões do usuário criador da chave.
curl --request GET \
--url https://api.wegly.com.br/integrations/external/chats/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.wegly.com.br/integrations/external/chats/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wegly.com.br/integrations/external/chats/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wegly.com.br/integrations/external/chats/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wegly.com.br/integrations/external/chats/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wegly.com.br/integrations/external/chats/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "OPEN",
"priority": 0,
"phone_number": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_number": "<string>",
"raw_number": "<string>",
"phone_number_id": "<string>"
},
"crm_person": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"birth_date": "2023-11-07T05:31:56Z",
"gender": 123,
"notes": "<string>",
"contacts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": 123,
"value": "<string>",
"primary": true
}
],
"documents": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": 123,
"label": "<string>",
"value": "<string>"
}
],
"address": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": 123,
"type": 123,
"name": "<string>",
"street": "<string>",
"number": "<string>",
"complement": "<string>",
"district": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
}
},
"channel_type": "WHATSAPP",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"participants": [
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
}
],
"whatsapp_flow_sessions": [
{
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"flow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"flow_name": "<string>",
"status": "ACTIVE",
"status_label": "<string>",
"is_active": true,
"started_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"current_step": {
"node_id": "<string>",
"node_key": "<string>",
"name": "<string>",
"status": "<string>",
"status_label": "<string>",
"branch_key": "<string>",
"branch_label": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
}
}
],
"pending_copilot_actions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"execution_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "<string>",
"chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"action_key": "<string>",
"status": "<string>",
"confidence": "<string>",
"requires_review": true,
"input_payload": "<unknown>",
"output_payload": null,
"failure_reason": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"executed_at": "2023-11-07T05:31:56Z"
}
],
"wa_contact_id": "<string>",
"contact_name": "<string>",
"contact_number": "<string>",
"chat_type": "INDIVIDUAL",
"unread_count": 123,
"is_manually_unread": true,
"archived_at": "2023-11-07T05:31:56Z",
"assigned_agent": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
},
"last_message": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "text",
"origin": "INBOUND",
"from_me": true,
"sent_via": "CONTACT",
"status": "processing",
"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>"
},
"crm_marketing_lead_source": [
{}
],
"transcription": "<string>",
"is_forwarded": true,
"whatsapp_ai_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"last_customer_msg_at": "2023-11-07T05:31:56Z",
"session_expires_at": "2023-11-07T05:31:56Z",
"can_send_open_message": true,
"has_pending_copilot_actions": true,
"pending_copilot_actions_count": 123,
"channel_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"display_name": "<string>",
"provider_status": "<string>"
},
"external_contact": {
"id": "<string>",
"handle": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
},
"legacy": {
"whatsapp_chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"whatsapp_phone_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"wa_contact_id": "<string>"
},
"remote_profile_name": "<string>",
"crm_marketing_lead_source": [
{}
],
"assignable_agents": [
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
}
]
}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.
Response
Operação realizada.
- Option 1
- Option 2
OPEN, RESOLVED, SNOOZED 0 = baixa, 1 = normal, 2 = alta, 3 = urgente.
0, 1, 2, 3 Show child attributes
Show child attributes
Show child attributes
Show child attributes
WHATSAPP Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
INDIVIDUAL, GROUP Show child attributes
Show child attributes
Show child attributes
Show child attributes
Indica se a janela atual permite mensagem aberta.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Incluído ao consultar os detalhes; pode ser omitido nos retornos das mutações.
Show child attributes
Show child attributes
