GET /api/surveyanswer/[surveyanswer_id]

Description

Get a single survey answer (or, single set of survey answers, as they are usually nested).

Parameters

surveyanswer_id

Int. Mandatory. ID to the SurveyAnswer object. Given in the URL (surveyanswer_id=2): "/api/surveyanswer/2"

limit

Int. Optional. Default: 20. Maximum: 100. Limit the size of the result set.

offset

Int. Optional. Default: 0. Offset the result set, starting at this index. For batching/paging.

view

String. Optional. "full" or "simple". Which type of object view to return.

fields

String. Optional. See Field customization.

Security

Superuser, manager or self

Return

Array of single SurveyAnswer object.

GET /api/surveyanswers

Description

Returns a list of survey answers, belonging to sruvey, organisation or person, depending on parameters.

Parameters

user_name

String. Optional. Get answers for person with this user name. Unlike many other places in the API, we will not return survey answers for the logged in user if user_name isn't present. user_name must be given if we want to get for a specific user.

organisation_id

Int. Optional. Get answers given for the organisation given.

survey_id

Int. Optional. Get all answers belonging to this survey.

view

String. Optional. "full" or "simple". Which type of object view to return.

start

Int. Optional. Offset result list to this point. For batching.

limit

Int. Optional. Limit result list to this. For batching.

fields

String. Optional. See Field customization.

Return

Array of SurveyAnswer objects

Security

Superuser, manager or self

POST /api/surveyanswer

Description

Create a new answer set for survey. This answer can be updated later, using the PUT function.

Parameters

user_name

String. Optional. User name for person answering survey.

organisation_id

Int. Optional. ID for organisation answering survey.

data

JSON. Mandatory. JSON structure containing the answers. Corresponds to the parent/child structure of the survey.

{
    "items":[
        {
            "competence_id": ID for Competence,
            "value": The answer,
            "file_data": Base64 encoded file contents,
            "file_name": File name for file ("document.pdf"),
            "file_title": Display title for file ("My document"),
            "children": [nested items]
        },
        ...
    ]
}

fields

String. Optional. See Field customization.

Security

Superuser, manager, self

Return

Array of single SurveyAnswer object.

PUT /api/surveyanswers/[surveyanswer_id]

Description

Store a new answer set for an existing survey answer. Technically, the underlying events will be kept from the previous answer, but the actual answers will be replaced.

Parameters

surveyanswer_id

Int. Mandatory. ID for the answer to update.

data

JSON. Mandatory. JSON structure containing the answers. Corresponds to the parent/child structure of the survey.

{
    "items":[
        {
            "competence_id": ID for Competence,
            "value": The answer,
            "children": [nested items]
        },
        ...
    ]
}

fields

String. Optional. See Field customization.

Security

Superuser, manager or self

Return

Array of single SurveyAnswer object

PUT /api/surveyanswers/[surveyanswer_id]/lock

Description

Lock the survey answer for further editing/updating answers. As a result, a following PUT request to the same answer will be denied, with a prompt to perform a POST in stead.

Parameters

surveyanswer_id

Int. Mandatory. ID for the answer to lock.

fields

String. Optional. See Field customization.

Security

Superuser, manager or admin for event or competence.

Return

Array of single SurveyAnswer object

PUT /api/surveyanswers/[surveyanswer_id]/unlock

Description

Unlock survey answer for further updates.

Parameters

surveyanswer_id

Int. Mandatory. ID for the answer to unlock.

fields

String. Optional. See Field customization.

Security

Superuser, manager or admin for event or competence.

Return

Array of single SurveyAnswer object