curl --request GET \
--url https://app.metricaas.com.br/v1/conversas \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.metricaas.com.br/v1/conversas"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.metricaas.com.br/v1/conversas', 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://app.metricaas.com.br/v1/conversas",
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://app.metricaas.com.br/v1/conversas"
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://app.metricaas.com.br/v1/conversas")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.metricaas.com.br/v1/conversas")
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{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone": "<string>",
"name": "<string>",
"channel": "whatsapp",
"atendimento": "aguardando",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_email": "<string>",
"lead_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unread": 123,
"last_message_at": "2023-11-07T05:31:56Z",
"last_direction": "in",
"last_message_type": "<string>",
"first_response_at": "2023-11-07T05:31:56Z",
"resolved_at": "2023-11-07T05:31:56Z",
"reopened_count": 123,
"esperando_ha_s": 123
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}Lista conversas com o estado de atendimento
O estado de atendimento de cada conversa — quem está esperando resposta, há quanto tempo, e com quem. É o que liga um painel de TV do time ou um alerta de “tem gente esperando” sem integração nenhuma do nosso lado.
Exige a capacidade inbox:view. Respeita o que a pessoa do token enxerga
no inbox: quem vê só as próprias conversas recebe só as próprias.
Atendimento não é etapa do funil. A etapa diz onde está a venda; o atendimento diz se alguém está falando com a pessoa agora.
curl --request GET \
--url https://app.metricaas.com.br/v1/conversas \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.metricaas.com.br/v1/conversas"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.metricaas.com.br/v1/conversas', 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://app.metricaas.com.br/v1/conversas",
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://app.metricaas.com.br/v1/conversas"
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://app.metricaas.com.br/v1/conversas")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.metricaas.com.br/v1/conversas")
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{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone": "<string>",
"name": "<string>",
"channel": "whatsapp",
"atendimento": "aguardando",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_email": "<string>",
"lead_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"unread": 123,
"last_message_at": "2023-11-07T05:31:56Z",
"last_direction": "in",
"last_message_type": "<string>",
"first_response_at": "2023-11-07T05:31:56Z",
"resolved_at": "2023-11-07T05:31:56Z",
"reopened_count": 123,
"esperando_ha_s": 123
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}Authorizations
Authorization: Bearer mcp_… — gere em Configurações → Tokens de API.
O token de API tem modo read ou write. Um token read responde 403
a qualquer verbo que não seja GET. As capacidades do token são a
interseção com as da pessoa de quem ele herda o papel: se ela perder
acesso na grade de Equipe, o token perde junto, sem ninguém revogar nada.
Query Parameters
aguardando— chegou mensagem e ninguém assumiu.em_atendimento— alguém assumiu a conversa.resolvida— encerrada.
aguardando, em_atendimento, resolvida whatsapp, instagram 1 devolve só as conversas em que a última fala foi do cliente —
a fila de trabalho de verdade, e o filtro que um alerta vai querer.
1 x <= 200Response
OK, das mais recentes para as mais antigas
Show child attributes
Show child attributes