When working with data for a specific Project like Issues or Nodes, make sure to define the Dradis-Project-Id
HTTP header like so:
$ curl \ -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"' \ -H 'Dradis-Project-Id: 3' \ https://dradis-pro.dev/pro/api/nodes
GET /pro/api/nodes
Retrieves all the Nodes in your specific project, ordered by the created_at
timestamp.
You can paginate the results for 25 views per page by appending e.g. \?page\=1
and \?page\=2
, so e.g. http://dradis-pro.dev/pro/api/nodes\?page\=1
.
Sample request:
curl \ -H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \ -H 'Dradis-Project-Id: 3' \ http://dradis-pro.dev/pro/api/nodes
Result:
[ { "id": 29, "label": "Scope", "type_id": 1, "parent_id": 16, "position": 0, "created_at": "2016-04-11T16:36:30.708Z", "updated_at": "2016-04-11T16:36:30.728Z", "evidence": [ ], "notes": [ { "id": 43, "category_id": 2, "title": "Project Properties", "fields": { "Title": "Project Properties", "dradis.Client": "Security Roots, Ltd", "dradis.Author": "William Adama", "dradis.Title": "Penetration Test", "dradis.Subtitle": "Mobile Banking Application" }, "text": "#[Title]#\nProject Properties\n\n#[dradis.Client]#\nSecurity Roots, Ltd\n\n#[dradis.Author]#\nWilliam Adama\n\n#[dradis.Title]#\nPenetration Test#[dradis.Subtitle]#\nMobile Banking Application\n" } ] }, { "id": 28, "label": "plugin.output", "type_id": 0, "parent_id": null, "position": 0, "created_at": "2016-04-11T16:36:30.698Z", "updated_at": "2016-04-11T16:36:30.698Z", "evidence": [ ], "notes": [ ] } ]
GET /pro/api/nodes/:id
Retrieves a single Node from your specified project and displays all the Evidence and Notes associated with the Node.
Sample request:
curl \ -H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \ -H 'Dradis-Project-Id: 3' \ http://dradis-pro.dev/pro/api/nodes/27
Result:
{ "id": 27, "label": "10.0.0.1", "type_id": 0, "parent_id": null, "position": 0, "created_at": "2016-04-11T16:36:30.418Z", "updated_at": "2016-04-11T16:36:30.418Z", "evidence": [ { "id": 52, "content": "#[Description]#\r\nbc. Placeholder evidence content ", "fields": { "Description": "bc. Placeholder evidence content", "Label": "Uploaded files" }, "issue": { "id": 51, "title": "Dangerous HTTP methods: TRACE", "url": "http://dradis-pro.dev/api/issues/51" } } ], "notes": [ ] }
POST /pro/api/nodes
Creates a Node in the specified project. The attributes for the Node must be provided in the POST body as JSON.
HTTP status 201
will be returned if the creation completes successfully, and a Location
header will be sent with the response, set to the URL of the newly created resource.
Accepted Parameter | Use |
---|---|
node |
Pass it the label , type_id , parent_id , and position parameters. |
label |
Pass it the name of the Node you want to create within your Dradis project. |
type_id |
Pass type_id a value of 0 to create a Default Node or a value of 1 to create a Host Node. |
parent_id |
Pass parent_id the ID of your desired parent Node to create a subnode. Or, use "parent_id": null, to create a top-level Node. |
position |
Pass position a numeric value to insert the new Node at a specific location within the existing Node structure |
Sample request:
curl \ -H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \ -H 'Dradis-Project-Id: 3' \ -H 'Content-type: application/json' \ -X POST \ -d '{"node": {"label": "New Node", "type_id": 1, "parent_id": 16, "position": 3}}' \ http://dradis-pro.dev/pro/api/nodes
Result:
{ "id": 31, "label": "New Node", "type_id": 1, "parent_id": 16, "position": 3, "created_at": "2016-04-12T20:50:41.559Z", "updated_at": "2016-04-12T20:50:41.559Z", "evidence": [ ], "notes": [ ] }
PUT /pro/api/nodes/:id
Updates a Node in your specified project. You can update some or all of the Node attributes with PUT
. See the POST
method above for details on the different options and attributes available for the Node endpoint.
HTTP status 200
will be returned if the update completes successfully.
See POST
above for details on the accepted parameters.
Sample request:
curl \ -H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \ -H 'Dradis-Project-Id: 3' \ -H 'Content-type: application/json' \ -X PUT \ -d '{"node": {"parent_id": null}}' \ http://dradis-pro.dev/pro/api/nodes/31
Result:
{ "id": 31, "label": "Updated Node Title", "type_id": 1, "parent_id": null, "position": 12, "created_at": "2016-04-12T20:50:41.559Z", "updated_at": "2016-04-12T21:00:24.634Z", "evidence": [ ], "notes": [ ] }
DELETE /pro/api/nodes/:id
Deletes a Node from your specified project. HTTP status 200
will be returned if the deletion completes successfully.
Sample request:
curl \ -H 'Authorization: Token token="hxMsNwttqN5bVNEYcrIF01s65"' \ -H 'Dradis-Project-Id: 3' \ -H 'Content-type: application/json' \ -X DELETE \ http://dradis-pro.dev/pro/api/nodes/31
Result:
{ "message": "Resource deleted successfully" }
Next help article: Issues endpoint →
Your email is kept private. We don't do the spam thing.