Survey results
Workforce module
GET/surveys/{id}/resultssurveys.results
Results, shown only once the minimum number of responses is met. A rule that refuses the request returns 422 with `refusal` and `reason`.
- Requires the capability knowledge.sop.publish.
- OAuth scopes: knowledge.
- Error statuses: 400, 401, 404, 422, 429. Errors are RFC 9457 problem details.
Path and query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| id | string (uuid) | Yes | Identifier of the survey. |
Response 200: SurveyResults
| Field | Type | Required | Description |
|---|---|---|---|
| survey_id | string (uuid) | Yes | Survey. |
| responses | integer | Yes | Responses so far.Constraints: range 0 to any |
| min_responses | integer | Yes | Responses needed before results show.Constraints: range 0 to any |
| threshold_met | boolean | Yes | Whether results show. |
| audience | integer | Yes | Members in the audience.Constraints: range 0 to any |
| questions | array of object | Yes | Per question results; empty below the threshold. |
{
"survey_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
"responses": 12,
"min_responses": 5,
"threshold_met": true,
"audience": 40,
"questions": []
}Code samples
curl -X GET "$XOS_BASE_URL/surveys/0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f/results" \
-H "Authorization: Bearer $XOS_API_KEY"const { data } = await xos.surveys.results("0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f");response = xos.surveys.results("0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f")xos surveys results 0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f