Projects endpoint

GET /pro/api/projects

Retrieves all projects, ordered by modification time (most recent first).

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"' \
  https://dradis-pro.dev/pro/api/projects

Result:

[
  {
    "id": 3,
    "name": "Test Project 3",
    "client": {
      "id": 1,
      "name": "Security Roots"
    },
    "created_at": "2015-07-27T13:12:31Z",
    "updated_at": "2015-07-27T13:12:31Z",
    "authors": [
      {
        "email": "my@email.com"
      }
    ],
    "owners": [
      {
        "email": "my@email.com"
      }
    ]
  },
  {
    "id": 2,
    "name": "Test Project 2",
    "client": {
      "id": 1,
      "name": "Security Roots"
    },
    "created_at": "2015-07-27T13:11:18Z",
    "updated_at": "2015-07-27T13:11:18Z",
    "authors": [
      {
        "email": "my@email.com"
      }
    ],
    "owners": [
      {
        "email": "my@email.com"
      }
    ]
  },
  {
    "id": 1,
    "name": "Test Project 1",
    "client": {
      "id": 1,
      "name": "Security Roots"
    },
    "created_at": "2015-07-06T15:55:30Z",
    "updated_at": "2015-07-07T08:28:22Z",
    "authors": [
      {
        "email": "my@email.com"
      }
    ],
    "owners": [
      {
        "email": "my@email.com"
      }
    ]
  }
]

GET /pro/api/projects/:id

Retrieves a single project.

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"' \
  https://dradis-pro.dev/pro/api/projects/1

Result:

{
  "id": 1,
  "name": "Test Project 1",
  "client": {
    "id": 1,
    "name": "Security Roots"
  },
  "created_at": "2015-07-06T15:55:30Z",
  "updated_at": "2015-07-07T08:28:22Z",
  "authors": [
    {
      "email": "my@email.com"
    }
  ],
  "owners": [
    {
      "email": "my@email.com"
    }
  ]
}

POST /pro/api/projects

Creates a project. The attributes for the project 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
project Pass it the name, client_id and report_template_properties_id parameters
name Pass it the name of the project you want to create within Dradis
client_id Assigns the project to a client. Pass it the ID number of the client the project should be associated with within Dradis.
report_template_properties_id (optional) Assigns a default report template to the project

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"'\
  -H 'Content-type: application/json' \
  -X POST \
  -d '{"project":{"name":"Test Project 4","client_id":"1", "report_template_properties_id":"4"}}' \
  http://dradis-pro.dev/pro/api/projects

Result:

{
  "id": 4,
  "name": "Test Project 4",
  "client": {
    "id": 1,
    "name": "Security Roots"
  },
  "created_at": "2015-07-28T15:14:24Z",
  "updated_at": "2015-07-28T15:14:24Z",
  "authors": [
    {
      "email": "my@email.com"
    }
  ],
  "owners": [
    {
      "email": "my@email.com"
    }
  ]
}

PUT /pro/api/projects/:id

Updates a project. The attributes to be updated must be provided in the POST body as JSON. 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="xMsNwttqN5bVNEYcrIF01s65"' \
  -H 'Content-type: application/json' \
  -X PUT \
  -d '{"project":{"name":"Test Project 4 - Updated"}}' \
  http://dradis-pro.dev/pro/api/projects/4

Result:

{
  "id": 4,
  "name": "Test Project 4 - Updated",
  "client": {
    "id": 1,
    "name": "Security Roots"
  },
  "created_at": "2015-07-28T15:14:24Z",
  "updated_at": "2015-07-28T15:14:24Z",
  "authors": [
    {
      "email": "my@email.com"
    }
  ],
  "owners": [
    {
      "email": "my@email.com"
    }
  ]
}

DELETE /pro/api/projects/:id

Deletes a project. HTTP status 200 will be returned if the deletion completes successfully.

Sample request:

$ curl \
  -H 'Authorization: Token token="xMsNwttqN5bVNEYcrIF01s65"' \
  -H 'Content-type: application/json' \
  -X DELETE \
  http://dradis-pro.dev/pro/api/projects/4

Result:

{
  message: "Resource deleted successfully"
}

Next help article: Nodes endpoint →