GET Survey details

Overview

The survey details endpoint returns the detailed description of a survey. This is useful for interpreting survey measurements returned by the measurement list endpoint. A valid survey UUID and the matching group UUID are required. Survey href values from the survey list endpoint correspond to the survey details endpoint.

Base path

/api/v1/groups/GROUP_UUID/surveys/SURVEY_UUID

Path parameters

GROUP_UUID

(string) The unique identifier for a group.

SURVEY_UUID

(string) The unique identifier for a survey within the specified group.

Parameters

version

(string) The desired version of the survey.

Curl example

curl -X GET \
'https://API_HOSTNAME/api/v1/groups/GROUP_UUID/ \
surveys/SURVEY_UUID?version=2' \
--header 'Authorization: Bearer BEARER_TOKEN'

Response

The response is a survey, including questions, scoring, and information screens.

Response body

{
    "uuid": "SURVEY_UUID",
    "type": "survey",
    "scoreKeys": [
        "total"
    ],
    "version": 2,
    "createdTime": "2021-07-29T20:08:07.108Z",
    "name": "survey name",
    "title": "Survey Title",
    "elements": [
        {
            "type": "surveyQuestion",
            "identifier": "height",
            "prompt": "<p>What is your height? </p>",
            "promptDetail": "<p>in feet and inches</p>"
        },
        {
            "type": "surveyQuestion",
            "identifier": "weight",
            "prompt": "<p>What is your weight?  Be honest!</p>"
        },
        {
            "type": "surveyQuestion",
            "identifier": "diabetes",
            "prompt": "<p><span style=\"background-color: transparent; color: rgb(0, 0, 0);\">Have you been told by a healthcare professional that you have Type 2 diabetes?</span></p>"
        },
        ...
        {
            "type": "surveySaveScreen",
            "identifier": "save",
            "prompt": "Please click \"Save\" to save and submit your results."
        }
    ]
}

Result attributes

uuid

(string) A unique identifier for the survey.

type

(string) The type of survey. Possible values: survey, quiz, slideshow

scoreKeys

(set of strings)

version

(number) The version of the survey.

createdTime

(timestamp) The moment that the given version of this survey was created.

name

(string) The name of the survey.

title

(string) The title of the survey.

chartTitle

(number) If this survey contains charitable elements, this is the name of the chart that appears in the administrator console.

elements

(list of JSON subdocuments) This is a list of all the elements of the survey. Each element corresponds to a page that is presented to the user, and contains either a question, some information, or a survey score. The content of each element varies by type, and whether certain optional data was supplied when the survey version was created.