Connected Component
Get the Connected Component of a project
This endpoint returns the Connected Component created from a project.
GET /api/v2/projects/{project_id}/connected-component/
GET /api/v2/projects/1/connected-component/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "CSC1",
"title": "Custom connected component",
"description": "Description for custom connected component",
"answer_mapping": {
"id": "CA1",
"text": "Custom answer",
"is_active": true,
"section_title": "Application General",
"subsection_text": "Components",
"question_text": "Components In Development",
"subquestion_text": null
},
"hidden": true,
"is_draft": false,
"tasks_implemented": [
{
"id": "T69",
"title": "Strong password requirements for server-to-server system accounts",
"url": "http://localhost:3000/library/tasks/T69/",
"active": true
}
],
"tasks_introduced": []
}
Creates a Connected Component
This endpoint creates a Connected Component.
PUT /api/v2/projects/{project_id}/connected-component/
Payload
Fields | Required | Description |
---|---|---|
title | Yes | The title of the component. |
description | No | A description of the component. |
answer_text | Yes | The survey answer to be created |
question_id | Yes | The survey question where the answer will be created |
tasks_implemented | No | A list of task item_id strings. |
tasks_introduced | No | A list of task item_id strings.default hidden will be set to true. |
Note that tasks_implemented
and tasks_introduced
should not share any common Countermeasures.
PUT /api/v2/projects/1/connected-component/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
{
"title": "Connected component",
"description": "here goes the description",
"answer_text": "myanswer",
"question_id": "CQ2",
"tasks_implemented": ["T12", "T13"],
"tasks_introduced": ["T7"]
}
HTTP/1.1 201 OK
Content-Type: application/json
{
"id": "CSC1",
"title": "Connected component",
"description": "here goes the description",
"answer_mapping": {
"id": "CA5",
"text": "myanswer",
"is_active": false,
"section_title": "Application General",
"subsection_text": "Components",
"question_text": "Components In Development",
"subquestion_text": null
},
"is_draft": false,
"tasks_implemented": [
{
"id": "T12",
"title": "Mask User Passwords by Default",
"url": "/library/tasks/T12/",
"active": true
},
{
"id": "T13",
"title": "Change Automatically Generated Passwords",
"url": "/library/tasks/T13/",
"active": true
}
],
"tasks_introduced": [
{
"id": "T7",
"title": "Salt and hash stored passwords",
"url": "/library/tasks/T7/",
"active": true
}
],
"hidden": true
}