Consulta de chat
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",
"wa_contact_id": "<string>",
"contact_name": "<string>",
"contact_number": "<string>",
"unread_count": 123,
"is_manually_unread": true,
"archived_at": "2023-11-07T05:31:56Z",
"assigned_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_number": "<string>",
"raw_number": "<string>",
"phone_number_id": "<string>"
},
"assigned_agent": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
},
"last_message_at": "2023-11-07T05:31:56Z",
"last_message": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from_me": true,
"body_text": "<string>",
"content_payload": {},
"reactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"emoji": "<string>",
"reactor_wa_id": "<string>",
"reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}
],
"meta_timestamp": "<string>",
"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": [
{}
]
},
"crm_person": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"birth_date": "2023-12-25",
"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>"
}
},
"remote_profile_name": "<string>",
"last_customer_msg_at": "2023-11-07T05:31:56Z",
"session_expires_at": "2023-11-07T05:31:56Z",
"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>"
}
}
],
"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>"
}
}
]
}Chats
Consulta de chat
Retorna os detalhes completos de um chat específico com participantes, vínculo CRM e última mensagem.
GET
/
integrations
/
external
/
chats
/
{id}
Consulta de chat
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",
"wa_contact_id": "<string>",
"contact_name": "<string>",
"contact_number": "<string>",
"unread_count": 123,
"is_manually_unread": true,
"archived_at": "2023-11-07T05:31:56Z",
"assigned_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_number": "<string>",
"raw_number": "<string>",
"phone_number_id": "<string>"
},
"assigned_agent": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
},
"last_message_at": "2023-11-07T05:31:56Z",
"last_message": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"from_me": true,
"body_text": "<string>",
"content_payload": {},
"reactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"emoji": "<string>",
"reactor_wa_id": "<string>",
"reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}
],
"meta_timestamp": "<string>",
"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": [
{}
]
},
"crm_person": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"birth_date": "2023-12-25",
"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>"
}
},
"remote_profile_name": "<string>",
"last_customer_msg_at": "2023-11-07T05:31:56Z",
"session_expires_at": "2023-11-07T05:31:56Z",
"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>"
}
}
],
"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
Utilize o token de integração no header Authorization: Bearer {token}. O domínio de origem (Origin/Referer) deve respeitar allowed_domain, quando configurado na chave.
Path Parameters
UUID do chat.
Response
Detalhes completos do chat.
Available options:
OPEN, RESOLVED, SNOOZED Available options:
INDIVIDUAL, GROUP 0 = baixa, 1 = normal, 2 = alta, 3 = urgente.
Available options:
0, 1, 2, 3 Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I
