curl --request GET \
--url https://app.metricaas.com.br/v1/me \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.metricaas.com.br/v1/me"
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/me', 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/me",
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/me"
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/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.metricaas.com.br/v1/me")
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{
"token": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mode": "read"
},
"client": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>"
},
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>"
},
"role": "manager",
"sees_all_leads": true,
"scopes": {
"channels": [
"whatsapp"
]
},
"capabilities": [
"<string>"
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}Quem é este token
Devolve a empresa, o papel, as capacidades efetivas e os escopos de dados do token.
Comece por aqui quando um lead ou uma venda “não aparecer”: na maioria das
vezes a resposta está em scopes — um token com scopes.channels: ["whatsapp"]
não enxerga lead do Instagram, e os totais mudam sem nenhum erro na resposta.
curl --request GET \
--url https://app.metricaas.com.br/v1/me \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.metricaas.com.br/v1/me"
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/me', 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/me",
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/me"
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/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.metricaas.com.br/v1/me")
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{
"token": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mode": "read"
},
"client": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>"
},
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>"
},
"role": "manager",
"sees_all_leads": true,
"scopes": {
"channels": [
"whatsapp"
]
},
"capabilities": [
"<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.
Response
OK
Show child attributes
Show child attributes
Show child attributes
Show child attributes
A pessoa de quem o token herda o papel — escolhida quando o token foi gerado, não necessariamente quem o gerou.
Show child attributes
Show child attributes
"manager"
{ "channels": ["whatsapp"] }