Notes

View notes for specific submission.

List all notes

GET /api/v1/notes

Example

curl -X GET https://api.ona.io/api/v1/notes

Response

[{
    "created_by": 1,
    "date_created": "2016-03-10T13:38:47.868430Z",
    "date_modified": "2016-03-10T13:38:47.868466Z",
    "id": 1,
    "instance": 1234,
    "instance_field": "",
    "note": "This is a test note"
}
...

List all notes to a submission

To view notes associated with a submission: - instance: The submission ID whose notes you want to list

Example

curl -X GET https://api.ona.io/api/v1/notes?instance=1234

Response

[{
    "created_by": 1,
    "date_created": "2016-03-10T13:38:47.868430Z",
    "date_modified": "2016-03-10T13:38:47.868466Z",
    "id": 1,
    "instance": 1234,
    "instance_field": "",
    "note": "This is a test note"
}
...

Add a note to a submission

To add notes to a submission you need the following parameters:

  • note: the text content of the note
  • instance: the submission instance ID you are adding notes on
  • instance_field: (optional) The specific question to associate the comment to on the submission instance specified.
POST /api/v1/notes

Example: without instance_field

curl -X POST https://api.ona.io/api/v1/notes -d "note=this is a test note" -d "instance=1234"

Response

[
    {
        "id":1238,
        "note":"This is a test note",
        "date_created":"2016-02-10T13:27:10.299003Z",
        "date_modified":"2016-02-10T13:27:10.299039Z",
        "instance":1234,
        "instance_field": null,
        "created_by":1
    }
]

Example: with instance_field

curl -X POST https://api.ona.io/api/v1/notes -d "note=this is a test note" -d "instance=1234" -d "instance_field=age"

Response

[
    {
        "id":1238,
        "note":"This is a test note",
        "date_created":"2016-02-10T13:27:10.299003Z",
        "date_modified":"2016-02-10T13:27:10.299039Z",
        "instance":1234,
        "instance_field": "age",
        "created_by":1
    }
]

Delete a Note

Where:
pk - is the note unique identifier
DELETE /api/v1/notes/{pk}

Example

curl -X DELETE https://api.ona.io/api/v1/notes/1234

Response

HTTP 204 NO CONTENT