API dei report
Un report IA legge un insieme di conversazioni completate e mette per iscritto il sentiment, i temi ricorrenti e i problemi. L’API restituisce i report che il tuo team ha creato nella dashboard. Non può crearne di nuovi. Per autenticazione, paginazione ed errori, vedi la Panoramica dell’API.
Elenca i report#
GET /api/v1/projects/{project_id}/reportsRestituisce i report di un progetto, dal più recente, senza il loro contenuto. I report eliminati sono esclusi.
Parametri della query#
| Parametro | Descrizione |
|---|---|
status | Uno o più tra generating, completed, failed, separati da virgole |
limit | Da 1 a 100. Predefinito 25. |
cursor | Il next_cursor della pagina precedente |
Esempio#
curl -G "https://diaform.io/api/v1/projects/b8acb3ab-1f3d-4a7e-a846-b7f493f86b6d/reports" \
-H "Authorization: Bearer $DIAFORM_API_KEY" \
--data-urlencode "status=completed"Risposta#
{
"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
}Campi del report#
| Campo | Tipo | Descrizione |
|---|---|---|
id | string | ID del report |
project_id | string | Il progetto a cui appartiene |
status | string | generating, completed o failed |
title | string o null | Il titolo che l’IA ha dato al report. null finché non è completato. |
focus | string o null | La domanda su cui il tuo team ha chiesto al report di concentrarsi, se c’è |
selection.mode | string | date_range (tutte le conversazioni completate in un periodo) o manual (conversazioni scelte a mano) |
selection.range_start, selection.range_end | string o null | Il periodo per date_range. null significa nessun limite da quel lato. |
conversation_count | number | Quante conversazioni copre il report |
first_conversation_at, last_conversation_at | string o null | Quando sono state create la più vecchia e la più recente delle conversazioni coperte |
sentiment_counts | object o null | Le conversazioni coperte, divise per sentiment complessivo. null finché il report non è completato. |
error_message | string o null | Perché un report failed non è riuscito |
created_at | string | Quando è stato richiesto il report |
completed_at | string o null | Quando è terminato o non è riuscito |
Ottieni un report#
GET /api/v1/reports/{report_id}Restituisce un report con tutti i campi dell’elenco, più conversation_ids e il content scritto.
Esempio#
curl "https://diaform.io/api/v1/reports/882f2ed7-07d9-4344-aced-9e523275b196" \
-H "Authorization: Bearer $DIAFORM_API_KEY"Risposta#
I campi in comune con l’elenco qui sono omessi.
{
"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"]
}
]
}
}Campi del contenuto#
content è null mentre il report è generating e quando è failed.
| Campo | Tipo | Descrizione |
|---|---|---|
conversation_ids | array | Tutte le conversazioni coperte dal report |
content.summary | string | Il riepilogo generale del report |
content.focus_answer | string o null | La risposta al focus del report, se ne è stato impostato uno |
content.sentiment_explanation | string | Cosa determina la ripartizione del sentiment |
content.themes | array | Gli argomenti ricorrenti, dal più citato |
content.themes[].tone | string | positive, negative, mixed o neutral |
content.issues | array | Problemi concreti da risolvere |
content.issues[].severity | string | high, medium o low |
content.outliers | array | Punti rilevanti sollevati solo da pochi rispondenti. Non hanno citazioni. |
title, detail | string | In ogni tema, problema e caso isolato: un titolo e una breve spiegazione |
mention_count | number | Quante conversazioni l’hanno sollevato |
conversation_ids | array | Quelle conversazioni. Recuperane una qualsiasi con l’API delle conversazioni. |
quotes[].text | string | Le parole del rispondente |
quotes[].translation | string o null | Una traduzione in inglese quando la citazione è in un’altra lingua |
quotes[].conversation_id | string | La conversazione da cui proviene la citazione |
quotes[].respondent_label | string o null | Chi l’ha detto, se è noto |
quotes[].created_at | string | Quando è stata creata quella conversazione |
Un report è un’istantanea delle conversazioni nel momento in cui è stato scritto. Se una conversazione viene eliminata in seguito, le sue citazioni vengono rimosse dal report.