Skip to content

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

surveys.results: Path and query parameters
FieldTypeRequiredDescription
idstring (uuid)YesIdentifier of the survey.

Response 200: SurveyResults

surveys.results: SurveyResults
FieldTypeRequiredDescription
survey_idstring (uuid)YesSurvey.
responsesintegerYesResponses so far.Constraints: range 0 to any
min_responsesintegerYesResponses needed before results show.Constraints: range 0 to any
threshold_metbooleanYesWhether results show.
audienceintegerYesMembers in the audience.Constraints: range 0 to any
questionsarray of objectYesPer 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