curl --request GET \
--url https://api.galtea.ai/analytics/products \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.galtea.ai/analytics/products"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.galtea.ai/analytics/products', 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.galtea.ai/analytics/products",
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.galtea.ai/analytics/products"
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.galtea.ai/analytics/products")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/analytics/products")
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[
{
"productId": "<string>",
"name": "<string>",
"tags": [
"<string>"
],
"current": {
"receivedCount": 123,
"evaluatedCount": 123,
"criticalFailureCount": 123
},
"previous": {
"receivedCount": 123,
"evaluatedCount": 123,
"criticalFailureCount": 123
},
"receivedBuckets": [
{
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"receivedCount": 123
}
],
"lastEvaluatedAt": "2023-11-07T05:31:56Z",
"costPerSession": 123,
"totalCost": 123,
"sessionsWithoutCostCount": 123
}
]{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}List products with their session stats for a period
One row per product the caller may read: sessions received, evaluated and with a critical failure in the period and in the period of the same length just before it, the latest evaluation, and the estimated cost per session. A product without analytics.read keeps its row with null stats. Pinned products come first, then the products that received a session in the period or have stats the caller may not read, then the others; the X-Active-Total header counts the first two groups. Inside a group, a product without analytics.read sorts last on every stats field.
curl --request GET \
--url https://api.galtea.ai/analytics/products \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.galtea.ai/analytics/products"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.galtea.ai/analytics/products', 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.galtea.ai/analytics/products",
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.galtea.ai/analytics/products"
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.galtea.ai/analytics/products")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/analytics/products")
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[
{
"productId": "<string>",
"name": "<string>",
"tags": [
"<string>"
],
"current": {
"receivedCount": 123,
"evaluatedCount": 123,
"criticalFailureCount": 123
},
"previous": {
"receivedCount": 123,
"evaluatedCount": 123,
"criticalFailureCount": 123
},
"receivedBuckets": [
{
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"receivedCount": 123
}
],
"lastEvaluatedAt": "2023-11-07T05:31:56Z",
"costPerSession": 123,
"totalCost": 123,
"sessionsWithoutCostCount": 123
}
]{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Authorizations
Query Parameters
Sort instructions (field and direction pairs). Fields: name, receivedCount, evaluatedCount, lastEvaluatedAt, criticalFailureRate, costPerSession. A product without analytics.read sorts last inside its group on every field but name, in both directions. costPerSession answers 400 unless the caller holds evaluation.readInference on every product whose analytics the caller may read. Default: criticalFailureRate desc.
Response
Products with their session stats