Library Countermeasure Amendments

Get All Library Countermeasure Amendments

This endpoint retrieves a list of Library Countermeasure Amendment resources.

GET /api/v2/library/tasks/{task_id}/amendments/

Query Parameters

Parameter Description
active The active status of the Library Countermeasure Amendment. Can be either true or false.
show_original Whether to return the original content for Built-In Modified Library Countermeasure Amendments (default is False).

URL Parameters

Parameter Description
task_id The id of the Library Countermeasure the Library Countermeasure Amendments to list belong to.
GET /api/v2/library/tasks/T1/amendments/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "results": [{
        "db_id": -1,
        "id": "CTA1",
        "title": "A Countermeasure Amendment",
        "text": "Countermeasure Amendment Description",
        "type": "Custom",
        "ordinal": 1,
        "last_updated_date": "2024-07-09T12:33:24.741899-04:00",
        "last_updated_by": {
            "id": 1,
            "email": "admin@example.com",
            "first_name": "Admin",
            "last_name": "Testerton"
        },
        "created_date_time": "2024-07-09T12:33:24.741883-04:00",
        "created_by": {
            "id": 1,
            "email": "admin@example.com",
            "first_name": "Admin",
            "last_name": "Testerton"
        },
        "active": true,
        "match_conditions": [
            {
                "db_id": -1,
                "id": "CMC1",
                "required": [
                    "A6"
                ],
                "excluded": []
            }
        ]
    }]
}

Get a Library Countermeasure Amendment

This endpoint retrieves a single Library Countermeasure Amendment resource.

GET /api/v2/library/tasks/{task_id}/amendments/{amendment_id}/

URL Parameters

Parameter Description
task_id The id of the Library Countermeasure the Library Countermeasure Amendment to retrieve belongs to.
amendment_id The id of the Library Countermeasure Amendment to retrieve.

All of the query parameters for the 'Get all Library Countermeasure Amendments' endpoint apply here as well.

GET /api/v2/library/tasks/T1/amendments/CTA1/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "db_id": -1,
    "id": "CTA1",
    "title": "A Countermeasure Amendment",
    "text": "Countermeasure Amendment Description",
    "type": "Custom",
    "ordinal": 1,
    "last_updated_date": "2024-07-09T12:33:24.741899-04:00",
    "last_updated_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "created_date_time": "2024-07-09T12:33:24.741883-04:00",
    "created_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "active": true,
    "match_conditions": [
        {
            "db_id": -1,
            "id": "CMC1",
            "required": [
                "A6"
            ],
            "excluded": []
        }
    ]
}

Create a Library Countermeasure Amendment

This endpoint creates a new Library Countermeasure Amendment resource.

POST /api/v2/library/tasks/{task_id}/amendments/

URL Parameters

Parameter Description
task_id The id of the Library Countermeasure the new Library Countermeasure Amendment belongs to.

Payload

Fields Required Description
title Yes The title of the Library Countermeasure Amendment.
text Yes The description text of the Library Countermeasure Amendment.
match_conditions No A list of dictionaries representing the set of match conditions belonging to this Library Countermeasure Amendment. Each dictionary has required and excluded fields which are arrays of answer IDs. When an answer is in the required array, this Library Countermeasure Amendment will be included in Project Countermeasures that include the answer. When an answer is in the excluded array, this Library Countermeasure Amendment will not be included in Project Countermeasures that include this answer.
active No Library Countermeasure Amendments can be activated or deactivated.
POST /api/v2/library/tasks/T1/amendments/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"

{
    "title": "A New Countermeasure Amendment",
    "text": "Countermeasure Amendment Description",
    "match_conditions": [
        {
            "required": ["A6"],
            "excluded": []
        }
    ],
    "active": true
}
HTTP/1.1 200 OK
Content-Type: application/json

{
    "db_id": -1,
    "id": "CTA1",
    "title": "A New Countermeasure Amendment",
    "text": "Countermeasure Amendment Description",
    "type": "Custom",
    "ordinal": 1,
    "last_updated_date": "2024-07-09T12:33:24.741899-04:00",
    "last_updated_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "created_date_time": "2024-07-09T12:33:24.741883-04:00",
    "created_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "active": true,
    "match_conditions": [
        {
            "db_id": -1,
            "id": "CMC1",
            "required": [
                "A6"
            ],
            "excluded": []
        }
    ]
}

Update a Library Countermeasure Amendment

This endpoint updates a specific Library Countermeasure Amendment resource, as specified by the id parameter.

PATCH /api/v2/library/tasks/{task_id}/amendments/{amendment_id}/

URL Parameters

Parameter Description
task_id The id of the Library Countermeasure the Library Countermeasure Amendment to update belongs to.
amendment_id The id of the Library Countermeasure Amendment to update.

Payload

Fields Required Description
title No The title of the Library Countermeasure Amendment.
text No The description text of the Library Countermeasure Amendment.
match_conditions No A list of dictionaries representing the set of match conditions belonging to this Library Countermeasure Amendment. Each dictionary has required and excluded fields which are arrays of answer IDs. When an answer is in the required array, this Library Countermeasure Amendment will be included in Project Countermeasures that include the answer. When an answer is in the excluded array, this Library Countermeasure Amendment will not be included in Project Countermeasures that include this answer.
active No Library Countermeasure Amendments can be activated or deactivated.
PATCH /api/v2/library/tasks/T1/amendments/CTA1/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"

{
    "title": "Updated Countermeasure Amendment",
    "text": "Updated Countermeasure Amendment Description",
    "match_conditions": [
        {
            "required": ["A2"],
            "excluded": []
        }
    ],
    "active": false
}
HTTP/1.1 200 OK
Content-Type: application/json

{
    "db_id": -1,
    "id": "CTA1",
    "title": "Updated Countermeasure Amendment",
    "text": "Updated Countermeasure Amendment Description",
    "type": "Custom",
    "ordinal": 1,
    "last_updated_date": "2024-07-09T14:43:00.593591-04:00",
    "last_updated_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "created_date_time": "2024-07-09T12:33:24.741883-04:00",
    "created_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "active": false,
    "match_conditions": [
        {
            "db_id": -2,
            "id": "CMC2",
            "required": [
                "A2"
            ],
            "excluded": []
        }
    ]
}

Delete a Library Countermeasure Amendment

This endpoint deletes a specific Library Countermeasure Amendment resource, as specified by the id parameter.

DELETE /api/v2/library/tasks/{task_id}/amendments/{amendment_id}/

URL Parameters

Parameter Description
task_id The id of the Library Countermeasure the Library Countermeasure Amendment to delete belongs to.
amendment_id The id of the Library Countermeasure Amendment to delete.
DELETE /api/v2/library/tasks/T1/amendments/CTA1/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 204 NO CONTENT
Content-Type: application/json

{}

results matching ""

    No results matching ""