2017-02-14 02:13:23 +00:00
|
|
|
## Project
|
|
|
|
|
|
|
|
> Example project:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"id": 2,
|
|
|
|
"tasks": [
|
|
|
|
7,
|
|
|
|
6,
|
|
|
|
5
|
|
|
|
],
|
|
|
|
"created_at": "2016-12-07T02:09:28.515319Z",
|
|
|
|
"name": "Test",
|
2017-06-15 18:34:51 +00:00
|
|
|
"description": "",
|
|
|
|
"permissions": [
|
|
|
|
"delete",
|
|
|
|
"change",
|
|
|
|
"add",
|
|
|
|
"view"
|
|
|
|
]
|
2017-02-14 02:13:23 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
A [Project](#project) is a collection of [Task](#task) items.
|
|
|
|
|
|
|
|
Field | Type | Description
|
|
|
|
----- | ---- | -----------
|
|
|
|
id | int | Unique identifier
|
|
|
|
tasks | int[] | List of task IDs associated with this project
|
|
|
|
created_at | string | Creation date and time
|
|
|
|
name | string | Name of the project
|
|
|
|
description | string | A more in-depth description
|
2017-06-15 18:34:51 +00:00
|
|
|
permissions | string[] | List of actions that the current user is allowed to perform. See [Permissions Values](#permission-values)
|
2017-02-14 02:13:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
### Create a project
|
|
|
|
|
|
|
|
`POST /api/projects/`
|
|
|
|
|
|
|
|
Parameter | Required | Default | Description
|
|
|
|
--------- | -------- | ------- | -----------
|
2017-02-20 23:58:25 +00:00
|
|
|
name | * | "" | Name of the project
|
2017-02-14 02:13:23 +00:00
|
|
|
description | | "" | A more in-depth description
|
|
|
|
|
2017-02-20 23:58:25 +00:00
|
|
|
|
|
|
|
### Update a project
|
|
|
|
|
|
|
|
`PATCH /api/projects/{id}/`
|
|
|
|
|
2017-02-25 21:04:09 +00:00
|
|
|
Parameters are the same as above.
|
2017-02-20 23:58:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
### Delete a project
|
|
|
|
|
|
|
|
`DELETE /api/projects/{id}/`
|
|
|
|
|
|
|
|
Upon deletion, all [Task](#task) items associated with the [Project](#project) are deleted also. The operation is irreversible.
|
|
|
|
|
2017-08-31 21:51:52 +00:00
|
|
|
### Get single project
|
|
|
|
|
|
|
|
`GET /api/projects/{id}/`
|
2017-02-20 23:58:25 +00:00
|
|
|
|
2017-02-14 02:13:23 +00:00
|
|
|
### Get list of projects
|
|
|
|
|
|
|
|
> Project list:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"count": 1,
|
|
|
|
"next": null,
|
|
|
|
"previous": null,
|
|
|
|
"results": [
|
|
|
|
{
|
|
|
|
"id": 2,
|
|
|
|
"tasks": [
|
|
|
|
7,
|
|
|
|
6,
|
|
|
|
5
|
|
|
|
],
|
|
|
|
"created_at": "2016-12-07T02:09:28.515319Z",
|
|
|
|
"name": "Test",
|
|
|
|
"description": ""
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2017-02-20 23:58:25 +00:00
|
|
|
`GET /api/projects/`
|
2017-02-14 02:13:23 +00:00
|
|
|
|
2017-02-20 23:58:25 +00:00
|
|
|
Parameter | Required | Default | Description
|
|
|
|
--------- | -------- | ------- | -----------
|
|
|
|
page | | 1 | Page number
|
|
|
|
id | | "" | Filter by id
|
|
|
|
name | | "" | Filter by name
|
|
|
|
description | | "" | Filter by description
|
|
|
|
created_at | | "" | Filter by created_at
|
|
|
|
ordering | | "" | Ordering field to sort results by
|
2017-02-14 02:13:23 +00:00
|
|
|
|
|
|
|
|
2017-02-20 23:58:25 +00:00
|
|
|
#### Example: Filtering by name
|
2017-02-14 02:13:23 +00:00
|
|
|
|
2017-02-20 23:58:25 +00:00
|
|
|
`GET /api/projects/?name=hello`
|
2017-02-14 02:13:23 +00:00
|
|
|
|
2017-02-20 23:58:25 +00:00
|
|
|
Retrieves projects that have a name of "hello".
|
2017-02-14 02:13:23 +00:00
|
|
|
|
|
|
|
|
2017-02-20 23:58:25 +00:00
|
|
|
#### Example: Sorting
|
2017-02-14 02:13:23 +00:00
|
|
|
|
2017-02-20 23:58:25 +00:00
|
|
|
`GET /api/projects/?ordering=-id`
|
2017-02-14 02:13:23 +00:00
|
|
|
|
2017-02-20 23:58:25 +00:00
|
|
|
Sort by project ID, descending order.
|
2017-02-14 02:13:23 +00:00
|
|
|
|
2017-02-20 23:58:25 +00:00
|
|
|
<aside class="notice">Only projects visible to the current user are returned.</aside>
|