Report a request
curl --request POST \
--url https://api.pezzo.ai/api/reporting/v2/request \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"client": "pezzo-ts",
"clientVersion": "0.4.11",
"environment": "Production",
"promptId": "c41jd0s93j000ud7kg7vekhi3"
},
"request": {
"timestamp": "2021-01-01T00:00:00.000Z",
"body": {}
},
"response": {
"timestamp": "2021-01-01T00:00:00.000Z",
"body": {}
},
"properties": {
"userId": "someUserId",
"traceId": "traceId"
},
"cacheEnabled": false,
"cacheHit": false
}
'import requests
url = "https://api.pezzo.ai/api/reporting/v2/request"
payload = {
"metadata": {
"client": "pezzo-ts",
"clientVersion": "0.4.11",
"environment": "Production",
"promptId": "c41jd0s93j000ud7kg7vekhi3"
},
"request": {
"timestamp": "2021-01-01T00:00:00.000Z",
"body": {}
},
"response": {
"timestamp": "2021-01-01T00:00:00.000Z",
"body": {}
},
"properties": {
"userId": "someUserId",
"traceId": "traceId"
},
"cacheEnabled": False,
"cacheHit": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {
client: 'pezzo-ts',
clientVersion: '0.4.11',
environment: 'Production',
promptId: 'c41jd0s93j000ud7kg7vekhi3'
},
request: {timestamp: '2021-01-01T00:00:00.000Z', body: JSON.stringify({})},
response: {timestamp: '2021-01-01T00:00:00.000Z', body: JSON.stringify({})},
properties: {userId: 'someUserId', traceId: 'traceId'},
cacheEnabled: false,
cacheHit: false
})
};
fetch('https://api.pezzo.ai/api/reporting/v2/request', 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.pezzo.ai/api/reporting/v2/request",
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([
'metadata' => [
'client' => 'pezzo-ts',
'clientVersion' => '0.4.11',
'environment' => 'Production',
'promptId' => 'c41jd0s93j000ud7kg7vekhi3'
],
'request' => [
'timestamp' => '2021-01-01T00:00:00.000Z',
'body' => [
]
],
'response' => [
'timestamp' => '2021-01-01T00:00:00.000Z',
'body' => [
]
],
'properties' => [
'userId' => 'someUserId',
'traceId' => 'traceId'
],
'cacheEnabled' => false,
'cacheHit' => false
]),
CURLOPT_HTTPHEADER => [
"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://api.pezzo.ai/api/reporting/v2/request"
payload := strings.NewReader("{\n \"metadata\": {\n \"client\": \"pezzo-ts\",\n \"clientVersion\": \"0.4.11\",\n \"environment\": \"Production\",\n \"promptId\": \"c41jd0s93j000ud7kg7vekhi3\"\n },\n \"request\": {\n \"timestamp\": \"2021-01-01T00:00:00.000Z\",\n \"body\": {}\n },\n \"response\": {\n \"timestamp\": \"2021-01-01T00:00:00.000Z\",\n \"body\": {}\n },\n \"properties\": {\n \"userId\": \"someUserId\",\n \"traceId\": \"traceId\"\n },\n \"cacheEnabled\": false,\n \"cacheHit\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.pezzo.ai/api/reporting/v2/request")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"client\": \"pezzo-ts\",\n \"clientVersion\": \"0.4.11\",\n \"environment\": \"Production\",\n \"promptId\": \"c41jd0s93j000ud7kg7vekhi3\"\n },\n \"request\": {\n \"timestamp\": \"2021-01-01T00:00:00.000Z\",\n \"body\": {}\n },\n \"response\": {\n \"timestamp\": \"2021-01-01T00:00:00.000Z\",\n \"body\": {}\n },\n \"properties\": {\n \"userId\": \"someUserId\",\n \"traceId\": \"traceId\"\n },\n \"cacheEnabled\": false,\n \"cacheHit\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pezzo.ai/api/reporting/v2/request")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"client\": \"pezzo-ts\",\n \"clientVersion\": \"0.4.11\",\n \"environment\": \"Production\",\n \"promptId\": \"c41jd0s93j000ud7kg7vekhi3\"\n },\n \"request\": {\n \"timestamp\": \"2021-01-01T00:00:00.000Z\",\n \"body\": {}\n },\n \"response\": {\n \"timestamp\": \"2021-01-01T00:00:00.000Z\",\n \"body\": {}\n },\n \"properties\": {\n \"userId\": \"someUserId\",\n \"traceId\": \"traceId\"\n },\n \"cacheEnabled\": false,\n \"cacheHit\": false\n}"
response = http.request(request)
puts response.read_bodyReporting
Report a request
Report a request
curl --request POST \
--url https://api.pezzo.ai/api/reporting/v2/request \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"client": "pezzo-ts",
"clientVersion": "0.4.11",
"environment": "Production",
"promptId": "c41jd0s93j000ud7kg7vekhi3"
},
"request": {
"timestamp": "2021-01-01T00:00:00.000Z",
"body": {}
},
"response": {
"timestamp": "2021-01-01T00:00:00.000Z",
"body": {}
},
"properties": {
"userId": "someUserId",
"traceId": "traceId"
},
"cacheEnabled": false,
"cacheHit": false
}
'import requests
url = "https://api.pezzo.ai/api/reporting/v2/request"
payload = {
"metadata": {
"client": "pezzo-ts",
"clientVersion": "0.4.11",
"environment": "Production",
"promptId": "c41jd0s93j000ud7kg7vekhi3"
},
"request": {
"timestamp": "2021-01-01T00:00:00.000Z",
"body": {}
},
"response": {
"timestamp": "2021-01-01T00:00:00.000Z",
"body": {}
},
"properties": {
"userId": "someUserId",
"traceId": "traceId"
},
"cacheEnabled": False,
"cacheHit": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {
client: 'pezzo-ts',
clientVersion: '0.4.11',
environment: 'Production',
promptId: 'c41jd0s93j000ud7kg7vekhi3'
},
request: {timestamp: '2021-01-01T00:00:00.000Z', body: JSON.stringify({})},
response: {timestamp: '2021-01-01T00:00:00.000Z', body: JSON.stringify({})},
properties: {userId: 'someUserId', traceId: 'traceId'},
cacheEnabled: false,
cacheHit: false
})
};
fetch('https://api.pezzo.ai/api/reporting/v2/request', 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.pezzo.ai/api/reporting/v2/request",
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([
'metadata' => [
'client' => 'pezzo-ts',
'clientVersion' => '0.4.11',
'environment' => 'Production',
'promptId' => 'c41jd0s93j000ud7kg7vekhi3'
],
'request' => [
'timestamp' => '2021-01-01T00:00:00.000Z',
'body' => [
]
],
'response' => [
'timestamp' => '2021-01-01T00:00:00.000Z',
'body' => [
]
],
'properties' => [
'userId' => 'someUserId',
'traceId' => 'traceId'
],
'cacheEnabled' => false,
'cacheHit' => false
]),
CURLOPT_HTTPHEADER => [
"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://api.pezzo.ai/api/reporting/v2/request"
payload := strings.NewReader("{\n \"metadata\": {\n \"client\": \"pezzo-ts\",\n \"clientVersion\": \"0.4.11\",\n \"environment\": \"Production\",\n \"promptId\": \"c41jd0s93j000ud7kg7vekhi3\"\n },\n \"request\": {\n \"timestamp\": \"2021-01-01T00:00:00.000Z\",\n \"body\": {}\n },\n \"response\": {\n \"timestamp\": \"2021-01-01T00:00:00.000Z\",\n \"body\": {}\n },\n \"properties\": {\n \"userId\": \"someUserId\",\n \"traceId\": \"traceId\"\n },\n \"cacheEnabled\": false,\n \"cacheHit\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.pezzo.ai/api/reporting/v2/request")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"client\": \"pezzo-ts\",\n \"clientVersion\": \"0.4.11\",\n \"environment\": \"Production\",\n \"promptId\": \"c41jd0s93j000ud7kg7vekhi3\"\n },\n \"request\": {\n \"timestamp\": \"2021-01-01T00:00:00.000Z\",\n \"body\": {}\n },\n \"response\": {\n \"timestamp\": \"2021-01-01T00:00:00.000Z\",\n \"body\": {}\n },\n \"properties\": {\n \"userId\": \"someUserId\",\n \"traceId\": \"traceId\"\n },\n \"cacheEnabled\": false,\n \"cacheHit\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pezzo.ai/api/reporting/v2/request")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"client\": \"pezzo-ts\",\n \"clientVersion\": \"0.4.11\",\n \"environment\": \"Production\",\n \"promptId\": \"c41jd0s93j000ud7kg7vekhi3\"\n },\n \"request\": {\n \"timestamp\": \"2021-01-01T00:00:00.000Z\",\n \"body\": {}\n },\n \"response\": {\n \"timestamp\": \"2021-01-01T00:00:00.000Z\",\n \"body\": {}\n },\n \"properties\": {\n \"userId\": \"someUserId\",\n \"traceId\": \"traceId\"\n },\n \"cacheEnabled\": false,\n \"cacheHit\": false\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Metadata
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Additional properties to be associated with the report
Example:
{ "userId": "someUserId", "traceId": "traceId" }
Whether caching is enabled for the report
Whether the report was generated from a cache hit or not
Response
Report has been reported successfully
âI