메인 콘텐츠로 건너뛰기
POST
/
feedback
/
stats
피드백 통계
curl --request POST \
  --url https://api.example.com/feedback/stats \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_id": "<string>",
  "start": "2023-11-07T05:31:56Z",
  "end": "2023-11-07T05:31:56Z",
  "feedback_type": "<string>",
  "granularity": 123,
  "metrics": [
    {
      "json_path": "<string>",
      "aggregations": [],
      "percentiles": [
        123
      ],
      "value_type": "numeric"
    }
  ],
  "timezone": "UTC",
  "trigger_ref": "<string>"
}
'
import requests

url = "https://api.example.com/feedback/stats"

payload = {
"project_id": "<string>",
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"feedback_type": "<string>",
"granularity": 123,
"metrics": [
{
"json_path": "<string>",
"aggregations": [],
"percentiles": [123],
"value_type": "numeric"
}
],
"timezone": "UTC",
"trigger_ref": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: '<string>',
start: '2023-11-07T05:31:56Z',
end: '2023-11-07T05:31:56Z',
feedback_type: '<string>',
granularity: 123,
metrics: [
{
json_path: '<string>',
aggregations: [],
percentiles: [123],
value_type: 'numeric'
}
],
timezone: 'UTC',
trigger_ref: '<string>'
})
};

fetch('https://api.example.com/feedback/stats', 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.example.com/feedback/stats",
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([
'project_id' => '<string>',
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z',
'feedback_type' => '<string>',
'granularity' => 123,
'metrics' => [
[
'json_path' => '<string>',
'aggregations' => [

],
'percentiles' => [
123
],
'value_type' => 'numeric'
]
],
'timezone' => 'UTC',
'trigger_ref' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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.example.com/feedback/stats"

payload := strings.NewReader("{\n \"project_id\": \"<string>\",\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"feedback_type\": \"<string>\",\n \"granularity\": 123,\n \"metrics\": [\n {\n \"json_path\": \"<string>\",\n \"aggregations\": [],\n \"percentiles\": [\n 123\n ],\n \"value_type\": \"numeric\"\n }\n ],\n \"timezone\": \"UTC\",\n \"trigger_ref\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Basic <encoded-value>")
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.example.com/feedback/stats")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"<string>\",\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"feedback_type\": \"<string>\",\n \"granularity\": 123,\n \"metrics\": [\n {\n \"json_path\": \"<string>\",\n \"aggregations\": [],\n \"percentiles\": [\n 123\n ],\n \"value_type\": \"numeric\"\n }\n ],\n \"timezone\": \"UTC\",\n \"trigger_ref\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/feedback/stats")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"<string>\",\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"feedback_type\": \"<string>\",\n \"granularity\": 123,\n \"metrics\": [\n {\n \"json_path\": \"<string>\",\n \"aggregations\": [],\n \"percentiles\": [\n 123\n ],\n \"value_type\": \"numeric\"\n }\n ],\n \"timezone\": \"UTC\",\n \"trigger_ref\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "end": "2023-11-07T05:31:56Z",
  "granularity": 123,
  "start": "2023-11-07T05:31:56Z",
  "timezone": "<string>",
  "buckets": [
    {}
  ],
  "window_stats": {}
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

인증

Authorization
string
header
필수

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

본문

application/json

시간 버킷별로 집계된 피드백 통계 요청입니다.

project_id
string
필수
start
string<date-time>
필수

시작 시간(포함, UTC, ISO 8601)입니다.

end
string<date-time> | null

종료 시간(미포함, UTC, ISO 8601)입니다. 생략하면 현재 시간이 기본값으로 사용됩니다.

feedback_type
string | null

feedback_type으로 필터링합니다.

granularity
integer | null

버킷 크기(초 단위)입니다. 생략하면 시간 범위를 기준으로 자동 선택됩니다.

metrics
FeedbackMetricSpec · object[]

payload_dump에서 집계할 메트릭입니다.

timezone
string
기본값:UTC

버킷 정렬에 사용할 IANA 시간대입니다.

trigger_ref
string | null

trigger_ref로 필터링합니다(all-versions의 경우 정확히 일치 또는 접두사 일치).

응답

성공 응답

시계열 피드백 통계를 포함한 응답입니다.

end
string<date-time>
필수

확정된 종료 시간입니다(요청한 시간대와 관계없이 항상 UTC).

granularity
integer
필수

사용된 버킷 크기(초 단위)입니다.

start
string<date-time>
필수

확정된 시작 시간입니다(요청한 시간대와 관계없이 항상 UTC).

timezone
string
필수

버킷 정렬에 사용된 시간대입니다.

buckets
Buckets · object[]

시간 버킷별 집계입니다. 각 dict에는 'timestamp'(ISO 문자열), 'count'(int), 그리고 요청된 각 메트릭+집계에 대한 '{agg}_{slug}' 키가 포함됩니다.

window_stats
Window Stats · object | null

전체 쿼리 기간에 대한 집계이며, 메트릭 슬러그(예: 'output_score')를 키로 사용합니다. 각 값은 agg 이름을 결과에 매핑합니다.