Countermeasure Notes
Get all Countermeasure notes
This endpoint returns a list of Countermeasure note resources.
GET /api/v2/projects/{project_id}/tasks/{task_id}/notes/
URL parameters
Parameter | Description |
---|---|
project_id | The id of the Project |
task_id | The id of the Countermeasure |
Query Parameters
The following parameters may be used to filter the notes resources in the response.
Parameter | Description |
---|---|
ordering | Sort notes ordered by the specified field. Sortable fields: created , updated . |
automatic | Filter automatic notes by specifying a boolean. |
updated | Filter notes updated exactly at the specified date. Note that if you would like to filter the date by UTC time, add a 'Z' to the end of the time. Otherwise, it is assumed you are filtering using local time. This is consistent with the ISO format, which we use for our dates. An example of the format can be found here: https://www.w3.org/TR/NOTE-datetime. |
updated__lt | Filter notes updated before the specified date. Note that if you would like to filter the date by UTC time, add a 'Z' to the end of the time. Otherwise, it is assumed you are filtering using local time. This is consistent with the ISO format, which we use for our dates. An example of the format can be found here: https://www.w3.org/TR/NOTE-datetime. |
updated__lte | Filter notes updated at or before the specified date. Note that if you would like to filter the date by UTC time, add a 'Z' to the end of the time. Otherwise, it is assumed you are filtering using local time. This is consistent with the ISO format, which we use for our dates. An example of the format can be found here: https://www.w3.org/TR/NOTE-datetime. |
updated__gt | Filter notes updated after the specified date. Note that if you would like to filter the date by UTC time, add a 'Z' to the end of the time. Otherwise, it is assumed you are filtering using local time. This is consistent with the ISO format, which we use for our dates. An example of the format can be found here: https://www.w3.org/TR/NOTE-datetime. |
updated__gte | Filter notes updated at or after the specified date. Note that if you would like to filter the date by UTC time, add a 'Z' to the end of the time. Otherwise, it is assumed you are filtering using local time. This is consistent with the ISO format, which we use for our dates. An example of the format can be found here: https://www.w3.org/TR/NOTE-datetime. |
GET /api/v2/projects/1/tasks/1-T2/notes/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json
{
"results": [{
"automatic": true,
"text": "This Countermeasure is on-hold until we...",
"id": 682,
"created": "2015-03-26T19:50:46.348000-05:00",
"updater": {
"id": 1,
"email": "admin@example.com",
"first_name": "Admin",
"last_name": "Testerton",
"is_active": true,
"role": {
"id": "UR4",
"name": "Administrator"
}
},
"updated": "2015-03-26T19:50:46.348000-05:00",
"extra": {
"ext_id": 1002
},
"task": "T2"
}]
}
Create a note for a Countermeasure
POST /api/v2/projects/{project_id}/tasks/{task_id}/notes/
URL parameters
Parameter | Description |
---|---|
project_id | The id of the Project |
task_id | The id of the Countermeasure |
Payload
Fields | Required | Description |
---|---|---|
text | Yes | The text for the Countermeasure note. |
POST /api/v2/projects/1/tasks/1-T2/notes/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
{
"text": "Desired text for a note."
}
HTTP/1.1 201 CREATED
Content-Type: application/json
{
"automatic": false,
"text": "Desired text for a note",
"id": 5,
"created": "2019-01-30T14:43:24.115695-05:00",
"updater": {
"id": 1,
"email": "test@example.com",
"first_name": "Admin",
"last_name": "Testerton",
"is_active": true,
"role": {
"id": "UR4",
"name": "Administrator"
}
},
"updated": "2019-01-30T14:43:24.115695-05:00",
"extra": {},
"task": "T2"
}
Update a Countermeasure note
PATCH /api/v2/projects/{project_id}/tasks/{task_id}/notes/{note_id}/
URL parameters
Parameter | Description |
---|---|
project_id | The id of the Project |
task_id | The id of the Countermeasure |
note_id | The id of the Note |
Payload
Fields | Required | Description |
---|---|---|
text | No | The text for the Countermeasure note. |
PATCH /api/v2/projects/1/tasks/1-T2/notes/5/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
{
"text": "Updated text for a note."
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"automatic": false,
"text": "Updated text for a note.",
"id": 5,
"created": "2019-01-30T14:43:24.115695-05:00",
"updater": {
"id": 1,
"email": "test@example.com",
"first_name": "Admin",
"last_name": "Testerton",
"is_active": true,
"role": {
"id": "UR4",
"name": "Administrator"
}
},
"updated": "2019-01-30T14:43:24.115695-05:00",
"extra": {},
"task": "T2"
}