Project Survey Draft
Reset the draft
Reverts changes to the draft to the last saved state.
DELETE /api/v2/projects/{project_id}/survey/draft/
DELETE /api/v2/projects/1/survey/draft/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json
{
"answers": [{
"id": "A21",
"selected": false,
"valid": true
}],
"survey_complete": true,
"dirty": false
}
Save the draft
This saves the current changes to the draft to the project. This may cause changes in the applicable tasks & other content for the project as well as accepting any other unaccepted changes to the tasks.
POST /api/v2/projects/{project_id}/survey/draft/
POST /api/v2/projects/1/survey/draft/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json
{
"answers": [{
"id": "A21",
"selected": false,
"valid": true
}],
"survey_complete": true,
"dirty": false
}
Modify an answer in the draft
Modifies the specified answer in the draft and returns the full draft state. This may affect other answer's selected and valid values.
PATCH /api/v2/projects/{project_id}/survey/draft/{answer_id}/
Field | Required | Description |
---|---|---|
selected | Yes | Selects or unselects the specified answer |
PATCH /api/v2/projects/1/survey/draft/A21/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
{"selected": true}
HTTP/1.1 200 OK
Content-Type: application/json
{
"answers": [{
"id": "A21",
"selected": true,
"valid": true
}],
"survey_complete": true,
"dirty": true
}
Clone a profile to the draft
Clears the current draft and uses the answers set on the specified profile for the draft instead. Any unsaved changes will be lost.
PATCH /api/v2/projects/{project_id}/survey/draft/
Field | Required | Description |
---|---|---|
profile | Yes | Profile id of profile to clone from |
PATCH /api/v2/projects/1/survey/draft/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
{"profile": "P21"}
HTTP/1.1 200 OK
Content-Type: application/json
{
"answers": [{
"id": "A21",
"selected": true,
"valid": true
}],
"survey_complete": true,
"dirty": true
}
Get the current state of the project survey draft
Returns the current state of the survey draft. All non-hidden answers are returned along with whether they are selected and whether they are valid for the current survey state. Dirty is a boolean representing whether the current draft state is different from the last saved survey.
GET /api/v2/projects/{project_id}/survey/draft/
GET /api/v2/projects/1/survey/draft/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json
{
"answers": [{
"id": "A1",
"selected": false,
"valid": true,
"question": "Q109"
}],
"survey_complete": true,
"dirty": false
}
Include Filters
See the Include Parameters section for more details.
Parameter | Description |
---|---|
survey | Includes a full representation of the survey structure with metadata |
Note: format
field: SC for single choice, else MC
GET /api/v2/projects/1/survey/draft/?include=survey HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json
{
"answers": [
{
"selected": false,
"question": "Q109",
"id": "A1",
"valid": true
},
{
"selected": true,
"question": "Q109",
"id": "A2",
"valid": true
}
],
"survey_complete": true,
"dirty": false,
"sections": [{
"id": "S1",
"title": "Application Survey",
"slug": "application-survey",
"subsections": [{
"id": "Q1",
"title": "Programming Language",
"questions": [{
"id": "Q21",
"text": "Is this a question?",
"description": "Help text",
"format": "MC",
"mandatory": false,
"satisfied": true,
"subquestions": [{
"mandatory": false,
"description": "",
"format": "MC",
"text": "Sub Question?",
"satisfied": true,
"answers": [
{
"description": "Description 1",
"text": "Answer 1",
"selected": false,
"selected_by": [],
"valid": true,
"id": "A11"
},
{
"description": "Description 2",
"text": "Answer 2",
"selected": false,
"selected_by": [],
"valid": true,
"id": "A12"
}
],
"id": "Q216"
}],
"answers": [{
"id": "A21",
"text": "Yes",
"description": "Help text",
"selected": false,
"valid": true,
"selected_by": []
}]
}]
}]
}]
}