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 noteinstance
: the submission instance ID you are adding notes oninstance_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
}
]