Project Survey History

Get a Project Survey's History

This endpoint retrieves a list of all logged updates to the Project Survey associated with the project with id "project_id".

GET /api/v2/projects/{project_id}/survey/history/

GET /api/v2/projects/1/survey/history/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "results": [{
        "project": 1,
        "answer": "A1",
        "actor": 5,
        "draft": true,
        "transition": "select",
        "reason": "manual",
        "timestamp": "2020-04-08T12:38:08.115521-04:00"
    }]
}

Query Parameters

The following parameters may be used to filter the project survey history log entries in the response:

Parameter Description
answer Returns history for specified answer. Supports multiple answers.
latest Returns only the most recent update for each answer.
draft If true, returns history for updates to project survey drafts only. If false, returns history for updates to project surveys only.
visible_only If true, excludes answers that are not visible in the project survey.

Expand Parameters

See the Expand Parameters section for more details.

Parameter Description
actor Actor field is expanded into id, first name, last name, email, role, active status, super user status, last login, date joined, and groups sub-fields.
answer Answer field is expanded into url, section_slug, section_id, question_id, subquestion_id, section_title, , subsection_text, question_text, subquestion_text, id, is_active and text.

GET /api/v2/projects/1/survey/history/?include=tags&expand=actor HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "results": [{
        "project": 1,
        "answer": {
            "id": "A735",
            "text": "Changes to session management",
            "is_active": true,
            "section_title": "Changes Since Last Release",
            "subsection_text": "General Changes",
            "question_text": "Changes Since Last Release",
            "subquestion_text": null,
            "section_slug": "scope",
            "subsection_id": "Q219",
            "question_id": "Q220",
            "subquestion_id": null,
            "url": "http://localhost:3000/bunits/bu/app/proj/tasks/survey/questions/scope/Q219/"
        },
        "actor": {
            "id": 5,
            "email": "hamish.stout@example.com",
            "first_name": "Hamish",
            "last_name": "Stout",
            "last_login": "2020-04-14T09:11:18.482369-04:00",
            "date_joined": "2011-05-25T11:37:55-04:00",
            "is_active": true,
            "is_superuser": false,
            "role": {
                "id": "UR1",
                "name": "User"
            },
            "groups": []
        },
        "draft": true,
        "transition": "select",
        "reason": "manual",
        "timestamp": "2020-04-08T12:38:08.115521-04:00"
    }]
}

Include Parameters

See the Include Parameters section for more details.

Parameter Description
carried_over_history Includes carried over history log entries from ancestor projects

GET /api/v2/projects/1/survey/history/?include=carried_over_history HTTP/1.1
Accept: application/json
Authorization: Token: "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "results": [
        {
            "project": 1,
            "answer": "A1",
            "actor": 5,
            "draft": true,
            "transition": "select",
            "reason": "manual",
            "time_stamp": "2020-04-08T12:38:08.115521-04:00"
        },
        {
            "project": 1,
            "answer": "A1",
            "actor": 5,
            "draft": false,
            "transition": "deselect",
            "reason": "survey-save",
            "time_stamp": "2020-02-20T12:38:08.115521-04:00"
        },
        {
            "project": 1,
            "answer": "A1",
            "actor": 5,
            "draft": true,
            "transition": "deselect",
            "reason": "profile-select",
            "time_stamp": "2020-02-20T12:38:08.115521-04:00"
        }
    ]
}

results matching ""

    No results matching ""