跳到主要内容

工作空间

方法与权限​

APIGETPOSTPUTPATCHDELETE
工作空间列表管理员, 工作空间管理员*, 工作空间编辑*, 工作空间查看*管理员, 工作空间管理员**---
工作空间详情管理员, 工作空间管理员, 工作空间编辑, 工作空间查看--管理员, 工作空间管理员-

*只能查看/编辑他们被允许查看/编辑的工作空间

** 工作空间管理员只能创建子工作空间。

获取工作空间列表​

端点: /workspaces/workspace/list/{level}/{sid}/{serializer}/

参数: level (路径, 字符串)​

organization

参数: sid (路径, 字符串)​

公司 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 Workspace"
},
...
]
}
# 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 Workspace",
"parent": null,
"description": "This is a sample workspace 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 Workspace",
"parent": null,
"description": "This is a sample workspace 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
},
...
]
}

创建工作空间​

端点: /workspaces/workspace/list/{level}/{sid}/{serializer}/

参数: level (路径, 字符串)​

sid

参数: sid (路径, 字符串)​

公司 sid

参数: serializer (路径, 字符串)​

参数: token (头部, 字符串)​

参数: name (正文, 字符串)​

参数: description (正文, 字符串)​

参数: date_start (正文, 字符串)​

参数: date_end (正文, 字符串)​

参数: is_archived (正文, 布尔值)​

参数: open_to_organization (正文, 布尔值)​

参数: metadata (正文, 对象)​

响应: 201​

{
"sid": "xxx",
"name": "Sample Workspace",
"parent": null,
"description": "This is a sample workspace 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
}

获取工作空间详情​

端点: /workspaces/workspace/detail/{sid}/

参数: sid (路径, 字符串)​

参数: token (头部, 字符串)​

响应: 200​

{
"sid": "xxx",
"name": "Sample Workspace",
"parent": null,
"description": "This is a sample workspace 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
}

更新工作空间​

端点: /workspaces/workspace/detail/{sid}/

参数: sid (路径, 字符串)​

参数: token (头部, 字符串)​

参数: name (正文, 字符串)​

参数: description (正文, 字符串)​

参数: date_start (正文, 字符串)​

参数: date_end (正文, 字符串)​

参数: is_archived (正文, 布尔值)​

参数: open_to_organization (正文, 布尔值)​

参数: metadata (正文, 对象)​

响应: 200​

{
"sid": "xxx",
"name": "Sample Workspace",
"parent": null,
"description": "This is a sample workspace 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
}