curl --request GET \
--url https://api.pictor.cloud/api/recording-segments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pictor.cloud/api/recording-segments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pictor.cloud/api/recording-segments', 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.pictor.cloud/api/recording-segments",
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.pictor.cloud/api/recording-segments"
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.pictor.cloud/api/recording-segments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pictor.cloud/api/recording-segments")
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{
"items": [
{
"camera_id": "<string>",
"partial": true,
"recording_id": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"storage_backend": "<string>",
"storage_bucket": "<string>",
"storage_key": "<string>",
"tenant_id": "<string>",
"alarm": {
"alarm_id": "<string>",
"account": "<string>",
"event_code": "<string>",
"event_group": "<string>",
"event_label": "<string>",
"event_ref": "<string>",
"occurred_at": "<string>",
"provider": "<string>",
"received_at": "2023-11-07T05:31:56Z",
"site_ref": "<string>",
"triage_state": "<string>"
},
"appliance_id": "<string>",
"camera_channel": 123,
"camera_manufacturer": "<string>",
"camera_model": "<string>",
"camera_name": "<string>",
"camera_ref": "<string>",
"client_name": "<string>",
"duration_s": 123,
"ended_at": "2023-11-07T05:31:56Z",
"file": "<string>",
"playback_url": "<string>",
"reason": "<string>",
"related": [],
"session": "<string>",
"site_address": "<string>",
"site_contact_name": "<string>",
"site_contact_phone": "<string>",
"site_external_ref": "<string>",
"site_id": "<string>",
"site_name": "<string>",
"size_bytes": 123
}
],
"limit": 123,
"offset": 123,
"total": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}O que um alarme mandou gravar
O que um alarme (ou uma ronda, ou alguém) mandou guardar — o acervo de gravações intencionais da conta, paginado e pesquisável.
Cada linha já vem tocável. playback_url é um endereço assinado e
temporário para o arquivo daquela gravação: quem lista pode tocar, sem uma
segunda chamada e sem conhecer nada do armazenamento. Ele vence — guarde os
bytes se precisa arquivar, nunca o link.
Quando a gravação nasceu de um evento, o bloco alarm diz qual evento: o
código, a descrição, a conta e a hora. Gravação manual ou agendada não tem esse
bloco, e a ausência é a informação (não inventamos uma origem para a linha não
ficar vazia).
Filtre por janela (from/to), por câmera, ou por texto livre em q — que
alcança nome de câmera, local, cliente, descrição do evento e conta.
camera_ref pode vir vazio, e isso é de propósito: ele promete o
identificador que casa com o seu lado, e quando a câmera foi apagada do cadastro
não existe esse identificador. camera_id sempre vem, mas pode cair no
identificador único interno nesse caso.
curl --request GET \
--url https://api.pictor.cloud/api/recording-segments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.pictor.cloud/api/recording-segments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.pictor.cloud/api/recording-segments', 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.pictor.cloud/api/recording-segments",
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.pictor.cloud/api/recording-segments"
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.pictor.cloud/api/recording-segments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pictor.cloud/api/recording-segments")
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{
"items": [
{
"camera_id": "<string>",
"partial": true,
"recording_id": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"storage_backend": "<string>",
"storage_bucket": "<string>",
"storage_key": "<string>",
"tenant_id": "<string>",
"alarm": {
"alarm_id": "<string>",
"account": "<string>",
"event_code": "<string>",
"event_group": "<string>",
"event_label": "<string>",
"event_ref": "<string>",
"occurred_at": "<string>",
"provider": "<string>",
"received_at": "2023-11-07T05:31:56Z",
"site_ref": "<string>",
"triage_state": "<string>"
},
"appliance_id": "<string>",
"camera_channel": 123,
"camera_manufacturer": "<string>",
"camera_model": "<string>",
"camera_name": "<string>",
"camera_ref": "<string>",
"client_name": "<string>",
"duration_s": 123,
"ended_at": "2023-11-07T05:31:56Z",
"file": "<string>",
"playback_url": "<string>",
"reason": "<string>",
"related": [],
"session": "<string>",
"site_address": "<string>",
"site_contact_name": "<string>",
"site_contact_phone": "<string>",
"site_external_ref": "<string>",
"site_id": "<string>",
"site_name": "<string>",
"size_bytes": 123
}
],
"limit": 123,
"offset": 123,
"total": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
Chave de API da conta, no formato pct_<prefixo>_<segredo>.
Query Parameters
busca textual (câmera/sessão/id) — base p/ busca semântica
1 <= x <= 500x >= 0