Survey Comments

Get All Survey Comments

This endpoint returns a list of all survey comments created for the specified project.

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

Query Parameters

The following parameters may be used to filter the survey comments resources in the response.

Parameter Description
question Filter applications by Question ID.

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

{
    "results": [
        {
            "author": {
                "id": 1,
                "email": "admin@example.com",
                "first_name": "Admin",
                "last_name": "Testerton",
                "is_active": true,
                "role": {
                    "id": "UR4",
                    "name": "Administrator"
                }
            },
            "created": "2020-07-20T17:32:12.016604-04:00",
            "id": 5,
            "locked": false,
            "pinned": false,
            "project": 1,
            "question": "Q107",
            "retained": false,
            "text": "Do you think this question applies to us?",
            "updated": "2020-07-20T17:32:12.016631-04:00"
        }
    ]
}

Get a Specific Survey Comment

This endpoint returns a specific Survey Comment. The survey comment to return is identified by the id.

GET /api/v2/projects/{project_id}/survey/comments/{comment_id}/

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

{
    "author": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton",
        "is_active": true,
        "role": {
            "id": "UR4",
            "name": "Administrator"
        }
    },
    "created": "2020-07-16T18:48:04.167427-04:00",
    "id": 1,
    "locked": false,
    "pinned": true,
    "project": 1,
    "question": "Q107",
    "retained": false,
    "text": "Do you think this question applies to us?",
    "updated": "2020-07-20T15:05:38.151619-04:00"
}

Create a Comment on a Survey Question

This endpoint creates a comment on a survey question.

POST /api/v2/projects/{project_id}/survey/comments/

Fields Required Description
question Yes The survey question that the comment is related to.
text Yes The content of the new comment.
pinned No A boolean field which allows you to pin the comment. Pinning the comment will unpin all other comments for the related question.
POST /api/v2/projects/1/survey/comments/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"

{  
    "text": "Do you think this question applies to us?",
    "question": "Q107"
}
HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "author": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton",
        "is_active": true,
        "role": {
            "id": "UR4",
            "name": "Administrator"
        }
    },
    "created": "2020-07-20T17:32:12.016604-04:00",
    "id": 5,
    "locked": false,
    "pinned": false,
    "project": 1,
    "question": "Q107",
    "text": "Do you think this question applies to us?",
    "updated": "2020-07-20T17:32:12.016631-04:00"
}

Update a Survey Comment

Update a single survey comment by specifying a new name and priority. The survey comment to update is identified by the id.

Note: Comments become "locked" after the project survey is saved. Once comments are locked they can no longer be modified.

PATCH /api/v2/projects/{project_id}/survey/comments/{comment_id}/

URL Parameters

Parameter Description
comment_id The id of the survey comment to edit must be submitted in the request.

Payload

Fields Required Description
pinned No A boolean field which allows you to pin or unpin a comment. Pinning a comment will unpin all other comments for the related question.
text No The content of the comment. Cannot be updated if the comment has been locked.
PATCH /api/v2/projects/survey/comments/1/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"

{
    "text": "I think this question applies to us",
    "pinned": true
}
HTTP/1.1 200 OK
Content-Type: application/json

{
    "author": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton",
        "is_active": true,
        "role": {
            "id": "UR4",
            "name": "Administrator"
        }
    },
    "created": "2020-07-16T18:48:04.167427-04:00",
    "id": 1,
    "locked": false,
    "pinned": true,
    "project": 1,
    "question": "Q107",
    "text": "I think this question applies to us",
    "updated": "2020-07-20T18:07:08.111789-04:00"
}

results matching ""

    No results matching ""