Lista odpowiedzi
Pobierz odpowiedzi z ankiety z opcjonalnym filtrowaniem.
GET
https://api.sentisnap.com/v1/surveys/{surveyId}/responses
Uwierzytelnianie
Wymaga klucza API z uprawnieniem responses:read.
Parametry ścieżki
| Parametr | Typ | Wymagany | Opis |
|---|---|---|---|
surveyId | string | Tak | Survey UUID |
Parametry zapytania
| Parametr | Typ | Wymagany | Opis |
|---|---|---|---|
page | integer | Nie | Page number (default: 1) |
per_page | integer | Nie | Number per page (default: 50, max: 100) |
filter[submittedAt][gte] | string | Nie | Filter by date (ISO 8601) |
filter[submittedAt][lte] | string | Nie | Filter by date (ISO 8601) |
Odpowiedź
{
"data": [
{
"id": "019def45-6789-0abc-def0-123456789abc",
"respondent_id": "resp_abc123",
"status": "completed",
"data": {
"question_uuid_1": "Very satisfied",
"question_uuid_2": [
"Feature A",
"Feature C"
],
"question_uuid_3": "The product is excellent and easy to use."
},
"metadata": {
"source": "email",
"language": "en",
"time_spent_seconds": 245
},
"started_at": "2024-01-20T14:20:00Z",
"submitted_at": "2024-01-20T14:24:05Z",
"created_at": "2024-01-20T14:20:00Z"
}
],
"meta": {
"page": 1,
"per_page": 50,
"total": 1250,
"total_pages": 25
},
"links": {
"self": "/v1/surveys/019abc.../responses?page=1",
"next": "/v1/surveys/019abc.../responses?page=2"
}
}Pola odpowiedzi
| Pole | Typ | Opis |
|---|---|---|
id | string | Unikalny identyfikator odpowiedzi |
respondent_id | string | Anonimowy identyfikator respondenta |
status | string | Status odpowiedzi: started, completed |
data | object | Odpowiedzi na pytania indeksowane według ID pytania |
metadata | object | Dodatkowe metadane odpowiedzi |
started_at | string | Kiedy respondent zaczął |
submitted_at | string | Kiedy odpowiedź została przesłana |
Przykład
# Get responses from the last 7 days
curl -X GET "https://public-api.sentisnap.com/v1/surveys/019abc.../responses?filter[submittedAt][gte]=2024-01-13T00:00:00Z" \
-H "Authorization: Bearer sk_live_..."Błędy
| Kod | Opis |
|---|---|
401 | Nieprawidłowy klucz API |
403 | Niewystarczające uprawnienia (wymaga responses:read) |
404 | Ankieta nie została znaleziona |