Insights
curl --request GET \
--url http://localhost:3000/api/v1/insights \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:3000/api/v1/insights"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:3000/api/v1/insights', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/insights",
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 := "http://localhost:3000/api/v1/insights"
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("http://localhost:3000/api/v1/insights")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/insights")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"days": 0,
"weeks": 0,
"answers": [
{
"week": "<string>",
"person": 0,
"agent": 0,
"anonymous": 0
}
],
"adoption": [
{
"week": "<string>",
"current": 0,
"superseded": 0
}
],
"stale": [
{
"asset": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"version": 0,
"preview": true,
"supersededBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"replacement": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"version": 0,
"preview": true,
"supersededBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"referrer": "<string>",
"fetches": 0,
"last": "<string>"
}
],
"top": [
{
"asset": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"version": 0,
"preview": true,
"supersededBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"total": 0,
"surfaces": {}
}
],
"gaps": [
{
"q": "<string>",
"searches": 0,
"last": "<string>"
}
],
"checks": {
"allowed": 0,
"refused": 0,
"reasons": [
{
"code": "<string>",
"count": 0
}
],
"log": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"at": "2023-11-07T05:31:56Z",
"asset": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"version": 0,
"preview": true,
"supersededBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"surface": "app",
"client": "<string>",
"context": "<string>",
"reasons": [
"<string>"
],
"offered": [
{
"asset": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"version": 0,
"preview": true,
"supersededBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"taken": true
}
]
}
]
},
"delivery": [
{
"day": "<string>",
"requests": 0,
"bytes": 123
}
],
"pageViews": [
{
"portal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"brand": {
"slug": "<string>",
"name": "<string>"
},
"page": "<string>",
"views": 0
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"detail": "<unknown>"
}
}API Reference
Insights
What the workspace’s events say: brand answers per week, release adoption and who still loads a replaced version, the most fetched assets by surface, searches that found nothing, the use-check log (refusals by reason, what was offered and whether it was taken), delivery traffic and portal page views. Events never hold an IP address, a person’s name or a full URL, and never leave this server.
Scope: write.
GET
/
api
/
v1
/
insights
Insights
curl --request GET \
--url http://localhost:3000/api/v1/insights \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:3000/api/v1/insights"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:3000/api/v1/insights', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/v1/insights",
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 := "http://localhost:3000/api/v1/insights"
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("http://localhost:3000/api/v1/insights")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/v1/insights")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"days": 0,
"weeks": 0,
"answers": [
{
"week": "<string>",
"person": 0,
"agent": 0,
"anonymous": 0
}
],
"adoption": [
{
"week": "<string>",
"current": 0,
"superseded": 0
}
],
"stale": [
{
"asset": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"version": 0,
"preview": true,
"supersededBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"replacement": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"version": 0,
"preview": true,
"supersededBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"referrer": "<string>",
"fetches": 0,
"last": "<string>"
}
],
"top": [
{
"asset": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"version": 0,
"preview": true,
"supersededBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"total": 0,
"surfaces": {}
}
],
"gaps": [
{
"q": "<string>",
"searches": 0,
"last": "<string>"
}
],
"checks": {
"allowed": 0,
"refused": 0,
"reasons": [
{
"code": "<string>",
"count": 0
}
],
"log": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"at": "2023-11-07T05:31:56Z",
"asset": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"version": 0,
"preview": true,
"supersededBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"surface": "app",
"client": "<string>",
"context": "<string>",
"reasons": [
"<string>"
],
"offered": [
{
"asset": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"version": 0,
"preview": true,
"supersededBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"taken": true
}
]
}
]
},
"delivery": [
{
"day": "<string>",
"requests": 0,
"bytes": 123
}
],
"pageViews": [
{
"portal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"brand": {
"slug": "<string>",
"name": "<string>"
},
"page": "<string>",
"views": 0
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"detail": "<unknown>"
}
}