Library Countermeasure Additional Requirements

Get All Library Countermeasure Additional Requirements

This endpoint retrieves a list of Library Countermeasure Additional Requirements resources.

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

Query Parameters

Parameter Description
active The active status of the Library Countermeasure Additional Requirements. Can be either true or false.
show_original Whether to return the original content for Built-In Modified Library Countermeasure Additional Requirements (default is False).
match_conditions A list of dictionaries representing the set of match conditions belonging to this Additional Requirement. Each dictionary has required and excluded fields which are arrays of answer IDs. When an answer is in the required array, this Additional Requirement will be included in projects that include the answer. When an answer is in the excluded array, this Library Weakness will not be included in projects that include this answer.

URL Parameters

Parameter Description
task_id The id of the Library Countermeasure the Library Countermeasure Additional Requirements to list belong to.
GET /api/v2/library/tasks/T1/amendments/?include=match_conditions 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 Additional Requirement",
        "text": "Countermeasure Additional Requirement 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 Additional Requirement

This endpoint retrieves a single Library Countermeasure Additional Requirement 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 Additional Requirement to retrieve belongs to.
amendment_id The id of the Library Countermeasure Additional Requirement to retrieve.

All of the query parameters for the 'Get all Library Countermeasure Additional Requirements' 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 Additional Requirement",
    "text": "Countermeasure Additional Requirement 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 Additional Requirement

This endpoint creates a new Library Countermeasure Additional Requirement 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 Additional Requirement belongs to.

Payload

Fields Required Description
title Yes The title of the Library Countermeasure Additional Requirement.
text Yes The description text of the Library Countermeasure Additional Requirement.
match_conditions No A list of dictionaries representing the set of match conditions belonging to this Library Countermeasure Additional Requirement. Each dictionary has required and excluded fields which are arrays of answer IDs. When an answer is in the required array, this Library Countermeasure Additional Requirement will be included in Project Countermeasures that include the answer. When an answer is in the excluded array, this Library Countermeasure Additional Requirement will not be included in Project Countermeasures that include this answer.
active No Library Countermeasure Additional Requirement 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 Additional Requirement",
    "text": "Countermeasure Additional Requirement 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 Additional Requirement",
    "text": "Countermeasure Additional Requirement 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 Additional Requirement

This endpoint updates a specific Library Countermeasure Additional Requirement 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 Additional Requirement to update belongs to.
amendment_id The id of the Library Countermeasure Additional Requirement to update.

Payload

Fields Required Description
title No The title of the Library Countermeasure Additional Requirement.
text No The description text of the Library Countermeasure Additional Requirement.
match_conditions No A list of dictionaries representing the set of match conditions belonging to this Library Countermeasure Additional Requirement. Each dictionary has required and excluded fields which are arrays of answer IDs. When an answer is in the required array, this Library Countermeasure Additional Requirement will be included in Project Countermeasures that include the answer. When an answer is in the excluded array, this Library Countermeasure Additional Requirement will not be included in Project Countermeasures that include this answer.
active No Library Countermeasure Additional Requirements 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 Additional Requirement",
    "text": "Updated Countermeasure Additional Requirement 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 Additional Requirement",
    "text": "Updated Countermeasure Additional Requirement 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 Additional Requirement

This endpoint deletes a specific Library Countermeasure Additional Requirement 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 Additional Requirement to delete belongs to.
amendment_id The id of the Library Countermeasure Additional Requirement 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 ""