curl --request GET \
--url https://agent-api.treble.ai/agent/company/agents \
--header 'Authorization: <authorization>'import requests
url = "https://agent-api.treble.ai/agent/company/agents"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://agent-api.treble.ai/agent/company/agents', 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://agent-api.treble.ai/agent/company/agents",
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: <authorization>"
],
]);
$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://agent-api.treble.ai/agent/company/agents"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://agent-api.treble.ai/agent/company/agents")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent-api.treble.ai/agent/company/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body[
{
"id": 4567,
"first_name": "Andrea",
"last_name": "Soto",
"email": "andrea.soto@suaempresa.com",
"tags": [
{
"id": 12,
"name": "Default"
},
{
"id": 18,
"name": "Comercial"
}
]
}
]Obter os agentes da sua empresa
Devolve os agentes da sua conta que podem receber conversas. Use-o para conhecer o id e o email de cada agente, que são os valores que você deve devolver do seu endpoint quando usa o destino API do bloco de Métodos de transferência.
Apenas os agentes ativos são devolvidos, portanto qualquer agente da resposta pode receber uma conversa.
Este endpoint vive no host da plataforma de agentes, agent-api.treble.ai, e não em main.treble.ai.
curl --request GET \
--url https://agent-api.treble.ai/agent/company/agents \
--header 'Authorization: <authorization>'import requests
url = "https://agent-api.treble.ai/agent/company/agents"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://agent-api.treble.ai/agent/company/agents', 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://agent-api.treble.ai/agent/company/agents",
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: <authorization>"
],
]);
$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://agent-api.treble.ai/agent/company/agents"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://agent-api.treble.ai/agent/company/agents")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent-api.treble.ai/agent/company/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body[
{
"id": 4567,
"first_name": "Andrea",
"last_name": "Soto",
"email": "andrea.soto@suaempresa.com",
"tags": [
{
"id": 12,
"name": "Default"
},
{
"id": 18,
"name": "Comercial"
}
]
}
]Cabeçalhos
API Key de autorização. Pode ser obtida em https://app.treble.ai/pt/dashboard/settings/developers
Resposta
Lista de agentes obtida corretamente
Identificador do agente no Treble. É o valor recomendado para devolver do seu endpoint de atribuição.
4567
Nome do agente.
"Andrea"
Sobrenome do agente.
"Soto"
Email do agente, tal como está registrado no Treble. O seu endpoint de atribuição também pode devolvê-lo em vez do id.
"andrea.soto@suaempresa.com"
Equipes às quais o agente pertence.
Show child attributes
Show child attributes
Esta página foi útil?