API raportów
Raport AI czyta zestaw zakończonych rozmów i opisuje sentyment, powtarzające się tematy i problemy. API zwraca raporty, które Twój zespół utworzył w panelu. Nie może tworzyć nowych. O uwierzytelnianiu, paginacji i błędach przeczytasz na stronie Przegląd API.
Lista raportów#
HTTP
GET /api/v1/projects/{project_id}/reportsZwraca raporty w projekcie, od najnowszych, bez ich treści. Usunięte raporty są pomijane.
Parametry zapytania#
| Parametr | Opis |
|---|---|
status | Jedna lub więcej wartości generating, completed, failed, rozdzielonych przecinkami |
limit | Od 1 do 100. Domyślnie 25. |
cursor | Wartość next_cursor z poprzedniej strony |
Przykład#
curl -G "https://diaform.io/api/v1/projects/b8acb3ab-1f3d-4a7e-a846-b7f493f86b6d/reports" \
-H "Authorization: Bearer $DIAFORM_API_KEY" \
--data-urlencode "status=completed"Odpowiedź#
JSON
{
"data": [
{
"id": "882f2ed7-07d9-4344-aced-9e523275b196",
"project_id": "b8acb3ab-1f3d-4a7e-a846-b7f493f86b6d",
"status": "completed",
"title": "Support problems overshadow a well-liked product",
"focus": null,
"selection": {
"mode": "date_range",
"range_start": "2026-05-01T00:00:00+00:00",
"range_end": "2026-05-31T23:59:59+00:00"
},
"conversation_count": 48,
"first_conversation_at": "2026-05-01T08:12:09.692998+00:00",
"last_conversation_at": "2026-05-30T13:11:09.628765+00:00",
"sentiment_counts": {
"positive": 14,
"negative": 11,
"neutral": 8,
"mixed": 15,
"unknown": 0
},
"error_message": null,
"created_at": "2026-06-01T09:33:49.465144+00:00",
"completed_at": "2026-06-01T09:34:07.2+00:00"
}
],
"has_more": false,
"next_cursor": null
}Pola raportu#
| Pole | Typ | Opis |
|---|---|---|
id | string | ID raportu |
project_id | string | Projekt, do którego należy raport |
status | string | generating, completed lub failed |
title | string lub null | Tytuł, który AI nadało raportowi. null, dopóki raport nie jest gotowy. |
focus | string lub null | Pytanie od Twojego zespołu, na którym raport ma się skupić, jeśli je podano |
selection.mode | string | date_range (wszystkie zakończone rozmowy z danego okresu) lub manual (ręcznie wybrane rozmowy) |
selection.range_start, selection.range_end | string lub null | Okres dla date_range. null oznacza brak ograniczenia z tej strony. |
conversation_count | number | Ile rozmów obejmuje raport |
first_conversation_at, last_conversation_at | string lub null | Kiedy utworzono najstarszą i najnowszą z objętych rozmów |
sentiment_counts | object lub null | Objęte rozmowy w podziale na ogólny sentyment. null, dopóki raport nie jest gotowy. |
error_message | string lub null | Dlaczego raport ze statusem failed się nie powiódł |
created_at | string | Kiedy zlecono raport |
completed_at | string lub null | Kiedy został ukończony lub się nie powiódł |
Pobieranie raportu#
HTTP
GET /api/v1/reports/{report_id}Zwraca jeden raport ze wszystkimi polami z listy oraz conversation_ids i treścią w content.
Przykład#
curl "https://diaform.io/api/v1/reports/882f2ed7-07d9-4344-aced-9e523275b196" \
-H "Authorization: Bearer $DIAFORM_API_KEY"Odpowiedź#
Pola wspólne z listą są tu pominięte.
JSON
{
"id": "882f2ed7-07d9-4344-aced-9e523275b196",
"status": "completed",
"title": "Support problems overshadow a well-liked product",
"conversation_ids": [
"0f8d43a2-6df9-49c8-bf5d-fd2b6ec2d9ee",
"912b8ced-f69d-4f50-b497-9a712fe59359"
],
"content": {
"summary": "Most respondents like the product and would recommend it, but support wait times came up in a quarter of the interviews.",
"focus_answer": null,
"sentiment_explanation": "Praise for the product is offset by frustration with support.",
"themes": [
{
"title": "Customer support is the top complaint",
"detail": "Twelve respondents described long waits before reaching support.",
"tone": "negative",
"mention_count": 12,
"conversation_ids": ["912b8ced-f69d-4f50-b497-9a712fe59359"],
"quotes": [
{
"conversation_id": "912b8ced-f69d-4f50-b497-9a712fe59359",
"text": "it took me 25 min to connect last time, which is too long",
"translation": null,
"respondent_label": "alex@acme.com",
"created_at": "2026-05-10T17:52:10.539708+00:00"
}
]
}
],
"issues": [
{
"title": "Invite emails land in spam",
"detail": "Three respondents never received their teammate invite.",
"severity": "high",
"mention_count": 3,
"conversation_ids": ["0f8d43a2-6df9-49c8-bf5d-fd2b6ec2d9ee"],
"quotes": []
}
],
"outliers": [
{
"title": "Request for an on-premise version",
"detail": "One enterprise respondent can't use cloud tools.",
"mention_count": 1,
"conversation_ids": ["0f8d43a2-6df9-49c8-bf5d-fd2b6ec2d9ee"]
}
]
}
}Pola treści#
content ma wartość null, gdy raport ma status generating lub failed.
| Pole | Typ | Opis |
|---|---|---|
conversation_ids | array | Wszystkie rozmowy objęte raportem |
content.summary | string | Ogólne podsumowanie raportu |
content.focus_answer | string lub null | Odpowiedź na focus raportu, jeśli go ustawiono |
content.sentiment_explanation | string | Co stoi za takim rozkładem sentymentu |
content.themes | array | Powtarzające się tematy, od najczęściej wspominanych |
content.themes[].tone | string | positive, negative, mixed lub neutral |
content.issues | array | Konkretne problemy do naprawy |
content.issues[].severity | string | high, medium lub low |
content.outliers | array | Warte uwagi kwestie poruszone tylko przez kilku respondentów. Nie mają cytatów. |
title, detail | string | Przy każdym temacie, problemie i odosobnionym głosie: nagłówek i krótkie wyjaśnienie |
mention_count | number | W ilu rozmowach to się pojawiło |
conversation_ids | array | Te rozmowy. Każdą z nich pobierzesz przez API rozmów. |
quotes[].text | string | Dosłowne słowa respondenta |
quotes[].translation | string lub null | Angielskie tłumaczenie, gdy cytat jest w innym języku |
quotes[].conversation_id | string | Rozmowa, z której pochodzi cytat |
quotes[].respondent_label | string lub null | Kto to powiedział, jeśli wiadomo |
quotes[].created_at | string | Kiedy utworzono tę rozmowę |
Raport to obraz rozmów z chwili, w której został napisany. Jeśli rozmowa zostanie później usunięta, jej cytaty są usuwane z raportu.