项目
方法与权限
| API | GET | POST | PUT | PATCH | DELETE |
|---|---|---|---|---|---|
| 项目列表 | 管理员, 项目管理员*, 项目编辑*, 项目查看* | 管理员, 项目管理员** | - | - | - |
| 项目详情 | 管理员, 项目管理员, 项目编辑, 项目查看 | - | - | 管理员, 项目管理员 | - |
*只能查看/编辑他们被允许查看/编辑的项目
** 项目管理员只能创建子项目。
获取项目列表
端点: /projects/project/list/{level}/{sid}/{serializer}/
参数: level (路径, 字符串)
organization
参数: sid (路径, 字符串)
organization sid
参数: serializer (路径, 字符串)
参数: token (头部, 字符串)
响应: 200
# serializer = name
{
"page_size": 10,
"page_number": 1,
"page_count": 1,
"count": 2,
"next": null,
"previous": null,
"add_permission": true,
"results": [
{
"sid": "xxx",
"name": "Sample Project"
},
...
]
}
# serializer = list
{
"page_size": 10,
"page_number": 1,
"page_count": 1,
"count": 2,
"next": null,
"previous": null,
"add_permission": true,
"results": [
{
"sid": "xxx",
"name": "Sample Project",
"parent": null,
"description": "This is a sample project created automatically. Please archive it on your production data.",
"date_start": "2020-02-10",
"date_end": null,
"is_archived": false,
"change_permission": true
},
...
]
}
# serializer = detail
{
"page_size": 10,
"page_number": 1,
"page_count": 1,
"count": 2,
"next": null,
"previous": null,
"add_permission": true,
"results": [
{
"sid": "xxx",
"name": "Sample Project",
"parent": null,
"description": "This is a sample project created automatically. Please archive it on your production data.",
"date_start": "2020-02-10",
"date_end": null,
"should_receive_weekly_digest": true,
"open_to_organization": false,
"open_to_public": false,
"metadata": [
],
"is_archived": false,
"number_of_records": 0,
"updated_by": "xxx",
"date_updated": "2020-02-10T03:02:22.241376Z",
"date_created": "2020-02-10T03:02:22.240056Z",
"change_permission": true
},
...
]
}
创建项目列表
端点: /projects/project/list/{level}/{sid}/{serializer}/
参数: level (路径, 字符串)
sid
参数: sid (路径, 字符串)
organization sid
参数: serializer (路径, 字符串)
参数: token (头部, 字符串)
参数: name (正文, 字符串)
参数: description (正文, 字符串)
参数: date_start (正文, 字符串)
参数: date_end (正文, 字符串)
参数: is_archived (正文, 布尔值)
参数: open_to_organization (正文, 布尔值)
参数: metadata (正文, 对象)
响应: 201
{
"sid": "xxx",
"name": "Sample Project",
"parent": null,
"description": "This is a sample project created automatically. Please archive it on your production data.",
"date_start": "2020-02-10",
"date_end": null,
"should_receive_weekly_digest": true,
"open_to_organization": false,
"open_to_public": false,
"metadata": [
],
"is_archived": false,
"number_of_records": 0,
"updated_by": "xxx",
"date_updated": "2020-02-10T03:02:22.241376Z",
"date_created": "2020-02-10T03:02:22.240056Z",
"change_permission": true
}
获取项目详情
端点: /projects/project/detail/{sid}/
参数: sid (路径, 字符串)
参数: token (头部, 字符串)
响应: 200
{
"sid": "xxx",
"name": "Sample Project",
"parent": null,
"description": "This is a sample project created automatically. Please archive it on your production data.",
"date_start": "2020-02-10",
"date_end": null,
"should_receive_weekly_digest": true,
"open_to_organization": false,
"open_to_public": false,
"metadata": [
],
"is_archived": false,
"number_of_records": 0,
"updated_by": "xxx",
"date_updated": "2020-02-10T03:02:22.241376Z",
"date_created": "2020-02-10T03:02:22.240056Z",
"change_permission": true
}
修补项目详情
端点: /projects/project/detail/{sid}/
参数: sid (路径, 字符串)
参数: token (头部, 字符串)
参数: name (正文, 字符串)
参数: description (正文, 字符串)
参数: date_start (正文, 字符串)
参数: date_end (正文, 字符串)
参数: is_archived (正文, 布尔值)
参数: open_to_organization (正文, 布尔值)
参数: metadata (正文, 对象)
响应: 200
{
"sid": "xxx",
"name": "Sample Project",
"parent": null,
"description": "This is a sample project created automatically. Please archive it on your production data.",
"date_start": "2020-02-10",
"date_end": null,
"should_receive_weekly_digest": true,
"open_to_organization": false,
"open_to_public": false,
"metadata": [
],
"is_archived": false,
"number_of_records": 0,
"updated_by": "xxx",
"date_updated": "2020-02-10T03:02:22.241376Z",
"date_created": "2020-02-10T03:02:22.240056Z",
"change_permission": true
}