Abre ou fecha a cadeira de uma pessoa
curl --request POST \
--url https://app.metricaas.com.br/v1/cadeiras/{userId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"aberta": true
}'import requests
url = "https://app.metricaas.com.br/v1/cadeiras/{userId}"
payload = { "aberta": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({aberta: true})
};
fetch('https://app.metricaas.com.br/v1/cadeiras/{userId}', 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/cadeiras/{userId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'aberta' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.metricaas.com.br/v1/cadeiras/{userId}"
payload := strings.NewReader("{\n \"aberta\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.metricaas.com.br/v1/cadeiras/{userId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"aberta\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.metricaas.com.br/v1/cadeiras/{userId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"aberta\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"aberta": true,
"mudou": true
}
}{
"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>"
}
]
}Atendimento
Abre ou fecha a cadeira de uma pessoa
Exige company:team — a mesma capacidade de gerir a Equipe — e um token
write. Um token não é “a própria pessoa”, então não existe pela API o
atalho da tela em que cada um abre a própria cadeira.
Mandar o estado atual devolve mudou: false e não grava evento.
POST
/
cadeiras
/
{userId}
Abre ou fecha a cadeira de uma pessoa
curl --request POST \
--url https://app.metricaas.com.br/v1/cadeiras/{userId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"aberta": true
}'import requests
url = "https://app.metricaas.com.br/v1/cadeiras/{userId}"
payload = { "aberta": True }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({aberta: true})
};
fetch('https://app.metricaas.com.br/v1/cadeiras/{userId}', 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/cadeiras/{userId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'aberta' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.metricaas.com.br/v1/cadeiras/{userId}"
payload := strings.NewReader("{\n \"aberta\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.metricaas.com.br/v1/cadeiras/{userId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"aberta\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.metricaas.com.br/v1/cadeiras/{userId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"aberta\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"aberta": true,
"mudou": true
}
}{
"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.
Path Parameters
Body
application/json
Response
OK
Show child attributes
Show child attributes