Library Component Questions

Get all Component Questions

This endpoint retrieves a list of Component Questions.

GET /api/v2/library/componentquestions/

Query Parameters

The following parameters may be used to filter the Component Questions in the response.

Parameter Description
component Filter Component Questions by its Component ID.
search Filter Component Questions by performing a textual search on its ID, text or description.

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

{
    "results": [
        {
            "id": "AQ1",
            "text": "Does the application support offline functionalities?",
            "description": "",
            "answers": ["AA1"],
            "component": "SC24",
            "created": "2024-01-26T12:05:01.200989-05:00",
            "updated": "2024-01-26T12:05:01.200797-05:00",
            "parent_answer": null,
            "db_id": 1
        },
        {
            "id": "AQ2",
            "text": "What encryption method is used to protect locally stored data?",
            "description": "",
            "answers": ["AA2", "AA3", "AA4", "AA5"],
            "component": "SC24",
            "created": "2024-01-26T12:07:53.253987-05:00",
            "updated": "2024-01-26T12:07:53.253863-05:00",
            "parent_answer": "AA1",
            "db_id": 2
        }
    ]
}

Expand Parameters

See the Expand Parameters section for more details.

Parameter Description
answers The answers field is expanded.
component The component field is expanded.

GET /api/v2/library/componentquestions/?expand=answers,component
Accept: application/json
Authorization: Token: "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "results": [
        {
            "id": "AQ1",
            "text": "Does the application support offline functionalities?",
            "description": "",
            "answers": [
                {
                    "id": 1,
                    "item_id": "AA1",
                    "text": "Yes",
                    "description": "",
                    "attribute": "AT1",
                    "sub_questions": ["AQ2"]
                }
            ],
            "component": {
                "id": 27,
                "item_id": "SC24",
                "title": "Mobile app"
            },
            "created": "2024-01-26T12:05:01.200989-05:00",
            "updated": "2024-01-26T12:05:01.200797-05:00",
            "parent_answer": null,
            "db_id": 1
        },
        {
            "id": "AQ2",
            "text": "What encryption method is used to protect locally stored data?",
            "description": "",
            "answers": [
                {
                    "id": 2,
                    "item_id": "AA2",
                    "text": "AES",
                    "description": "",
                    "attribute": "AT2",
                    "sub_questions": []
                },
                {
                    "id": 3,
                    "item_id": "AA3",
                    "text": "MD5",
                    "description": "",
                    "attribute": "AT3",
                    "sub_questions": []
                },
                {
                    "id": 4,
                    "item_id": "AA4",
                    "text": "DES",
                    "description": "",
                    "attribute": "AT4",
                    "sub_questions": []
                },
                {
                    "id": 5,
                    "item_id": "AA5",
                    "text": "None",
                    "description": "",
                    "attribute": "AT5",
                    "sub_questions": []
                }
            ],
            "component": {
                "id": 27,
                "item_id": "SC24",
                "title": "Mobile app"
            },
            "created": "2024-01-26T12:07:53.253987-05:00",
            "updated": "2024-01-26T12:07:53.253863-05:00",
            "parent_answer": "AA1",
            "db_id": 2
        }
    ]
}

Get a specific Component Question

This endpoint retrieves a specific Component Question.

GET /api/v2/library/componentquestions/{component_question_id}/

URL Parameters

Parameter Description
component_question_id The id of the Component Question to retrieve.
GET /api/v2/library/componentquestions/AQ1/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": "AQ1",
    "text": "What cardholder data elements are stored?",
    "description": "",
    "answers": [
        "AA1",
        "AA2"
    ],
    "component": "SC2",
    "created": "2023-08-22T10:47:24.946501-04:00",
    "updated": "2023-08-22T15:33:35.874367-04:00",
    "parent_answer": null,
    "db_id": 1
}

Expand Parameters

See the Expand Parameters section for more details.

Parameter Description
answers The answers field is expanded.
component The component field is expanded.

GET /api/v2/library/componentquestions/AQ1/?expand=answers,component
Accept: application/json
Authorization: Token: "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": "AQ1",
    "text": "What cardholder data elements are stored?",
    "description": "",
    "answers": [
        {
            "id": 1,
            "item_id": "AA1",
            "text": "CAV2 / CVC2 / CVV2 / CID",
            "description": "",
            "attribute": "AT1",
            "sub_questions": []
        },
        {
            "id": 2,
            "item_id": "AA2",
            "text": "Magnetic strip or chip full track data",
            "description": "",
            "attribute": "AT2",
            "sub_questions": []
        }
    ],
    "component": {
        "id": 5,
        "item_id": "SC2",
        "title": "Generic database"
    },
    "created": "2023-08-23T15:09:23.690673-04:00",
    "updated": "2023-08-23T15:11:35.114961-04:00",
    "parent_answer": null,
    "db_id": 1
}

Create a Custom Component Question

This endpoint creates a Custom Component Question.

POST /api/v2/library/componentquestions/

Payload

Fields Required Description
text Yes The question text.
description No A description of the question.
answers Yes A list of answer representations (see below).
component Yes The ID of the component you wish to have this component associated with.
question_type Yes The type of question. Must be one of "SC" or "MC".

Answer Representation

Fields Required Description
text Yes The answer text.
description No A description of the answer.
attribute Yes The ID of the attribute you wish to have this answer associated with.
sub_questions Yes A list of sub-question IDs.
POST /api/v2/library/componentquestions/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"

{
    "text": "What cardholder data elements are stored?",
    "description": "This is a description",
    "answers": [
        {
            "text": "CAV2 / CVC2 / CVV2 / CID",
            "description": "This is another description",
            "attribute": "AT1",
            "sub_questions": [
                "AQ2"
            ]
        },
        {
            "text": "Magnetic strip or chip full track data",
            "description": "This is yet another description",
            "attribute": "AT2",
            "sub_questions": []
        }
    ],
    "component": "SC2",
    "question_type": "MC"
}
HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "id": "CAQ1",
    "text": "What cardholder data elements are stored?",
    "description": "This is a description",
    "answers": [
        {
            "id": "CAA1",
            "text": "CAV2 / CVC2 / CVV2 / CID",
            "description": "This is another description",
            "attribute": "AT1",
            "sub_questions": [
                "AQ11"
            ]
        },
        {
            "id": "CAA2",
            "text": "Magnetic strip or chip full track data",
            "description": "This is yet another description",
            "attribute": "AT2",
            "sub_questions": []
        }
    ],
    "component": "SC2",
    "created": "2024-05-23T09:47:32.577719-04:00",
    "updated": "2024-05-23T09:47:32.577744-04:00",
    "parent_answer": null,
    "question_type": "MC",
    "db_id": -1
}

Update a Component Question

This endpoint updates a Component Question.

PATCH /api/v2/library/componentquestions/{component_question_id}/

Payload

Fields Required Description
text No The question text.
description No A description of the question.
answers No A list of answer representations (see below).
component No The ID of the component you wish to have this component associated with.
question_type No The type of question. Must be one of "SC" or "MC".

Answer Representation

Fields Required Description
text No The answer text.
description No A description of the answer.
attribute No The ID of the attribute you wish to have this answer associated with.
sub_questions No A list of sub-question IDs.
PATCH /api/v2/library/componentquestions/CAQ1/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"

{
    "text": "What cardholder data elements are stored?",
    "description": "This is a description",
    "answers": [
        {
            "text": "CAV2 / CVC2 / CVV2 / CID",
            "description": "This is another description",
            "attribute": "AT1",
            "sub_questions": [
                "AQ2"
            ]
        },
        {
            "text": "Magnetic strip or chip full track data",
            "description": "This is yet another description",
            "attribute": "AT2",
            "sub_questions": []
        }
    ],
    "component": "SC2",
    "question_type": "MC"
}
HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": "CAQ1",
    "text": "What cardholder data elements are stored?",
    "description": "This is a description",
    "answers": [
        {
            "id": "CAA1",
            "text": "CAV2 / CVC2 / CVV2 / CID",
            "description": "This is another description",
            "attribute": "AT1",
            "sub_questions": [
                "AQ11"
            ]
        },
        {
            "id": "CAA2",
            "text": "Magnetic strip or chip full track data",
            "description": "This is yet another description",
            "attribute": "AT2",
            "sub_questions": []
        }
    ],
    "component": "SC2",
    "created": "2024-05-23T09:47:32.577719-04:00",
    "updated": "2024-05-23T09:47:32.577744-04:00",
    "parent_answer": null,
    "question_type": "MC",
    "db_id": -1
}

results matching ""

    No results matching ""