章节
方法与权限
| API | GET | POST | PUT | PATCH | DELETE |
|---|---|---|---|---|---|
| 章节列表 | 管理员, 项目管理员, 项目编辑, 项目查看 | 项目管理员*, 项目编辑* | - | 项目管理员*, 项目编辑* | - |
| 章节详情 | 管理员, 项目管理员, 项目编辑, 项目查看 | - | - | 项目管理员*, 项目编辑* | 管理员** |
*如果 row.is_locked=True,则无法发布/修改章节,除非小插件可以添加在只读状态下
*如果 row.is_archived=True,则无法发布/修改章节
**仅可以删除章节表
获取章节列表
端点: /tables/section/list/{level}/{sid}/{serializer}/
需要 table__sid 或 row__sid。
参数: level (路径, 字符串)
组织
参数: sid (路径, 字符串)
组织 sid
参数: serializer (路径, 字符串)
其中之一为 [name, list, detail]
参数: token (头部, 字符串)
参数: row__sid (查询, 字符串)
参数: table__sid (查询, 字符串)
响应: 200
# serializer = name
{
"page_size": 10,
"page_number": 1,
"page_count": 1,
"count": 6,
"next": null,
"previous": null,
"add_permission": true,
"results": [
{
"sid": "xxx",
"name": "Overview",
"widget___widget__sid": "xxx"
},
]
}
# serializer = list
{
"page_size": 10,
"page_number": 1,
"page_count": 1,
"count": 6,
"next": null,
"previous": null,
"add_permission": true,
"results": [
{
"sid": "xxx",
"name": "Overview",
"widget": {
"sid": "xxx",
"name": "Rich Text (CKEditor Classic) - Smart WYSIWYG HTML editor"
},
"description": "The short description of the experiment",
"price": "$0.00",
"is_archived": false,
"row": null,
"table": {
"sid": "xxx",
"name": "experiments"
},
"order": 1,
"change_permission": true
},
]
}
# serializer = detail
{
"page_size": 10,
"page_number": 1,
"page_count": 1,
"count": 6,
"next": null,
"previous": null,
"add_permission": true,
"results": [
{
"sid": "xxx",
"table": {
"sid": "xxx",
"name": "experiments"
},
"row": null,
"name": "Overview",
"description": "The short description of the experiment",
"widget": {
"sid": "xxx",
"icon": "format_color_text",
"name": "Rich Text (CKEditor Classic)",
"category": "Office",
"sub_category": "Text, Word, Docs",
"company": "Labii Inc.",
"notes": "Smart WYSIWYG HTML editor",
"description": "CKEditor is a WYSIWYG rich text editor which enables writing content directly inside of web pages or online applications. Its core code is written in JavaScript and it is developed by CKSource.",
"documentation_url": "https://docs.labii.com/widgets/office/text#rich-text-ckeditor-classic",
"usecase": "Protocol Steps; Experiment Overview; Descriptional Result;",
"type": "Section",
"constructor": "object",
"related_to": "Rich Text (CKEditor Balloon), Rich Text (Draft.js - deprecated), Plain Text, Google Docs, Microsoft Word, Microsoft Word (Personal), Microsoft Word (Business)",
"version": "1.00",
"release_date": "2020-04-19",
"order": "2.00",
"subscription_price": "Free",
"ppu_price": "0.15",
"allow_multiple": true,
"is_readonly": false,
"metadata_labels": "",
"data": "{\"html\": \"\"}",
"default_data": ""
},
"data": {
},
"order": 1,
"metadata": {
},
"is_archived": false,
"date_updated": "2020-02-10T03:02:27.029364Z",
"date_created": "2020-02-10T03:02:27.026207Z",
"updated_by": "xxx",
"change_permission": true
},
]
}
发布章节列表
端点: /tables/section/list/{level}/{sid}/{serializer}/
参数: level (路径, 字符串)
组织
参数: sid (路径, 字符串)
组织 sid
参数: serializer (路径, 字符串)
其中之一为 [name, list, detail]
参数: token (头部, 字符串)
参数: row__sid (查询, 字符串)
参数: widget (正文, 对象)
参数: name (正文, 字符串)
参数: description (正文, 字符串)
响应: 201
{
"sid": "xxx",
"table": {
"sid": "xxx",
"name": "experiments"
},
"row": null,
"name": "Overview",
"description": "The short description of the experiment",
"widget": {
"sid": "xxx",
"icon": "format_color_text",
"name": "Rich Text (CKEditor Classic)",
"category": "Office",
"sub_category": "Text, Word, Docs",
"company": "Labii Inc.",
"notes": "Smart WYSIWYG HTML editor",
"description": "CKEditor is a WYSIWYG rich text editor which enables writing content directly inside of web pages or online applications. Its core code is written in JavaScript and it is developed by CKSource.",
"documentation_url": "https://docs.labii.com/widgets/office/text#rich-text-ckeditor-classic",
"usecase": "Protocol Steps; Experiment Overview; Descriptional Result;",
"type": "Section",
"constructor": "object",
"related_to": "Rich Text (CKEditor Balloon), Rich Text (Draft.js - deprecated), Plain Text, Google Docs, Microsoft Word, Microsoft Word (Personal), Microsoft Word (Business)",
"version": "1.00",
"release_date": "2020-04-19",
"order": "2.00",
"subscription_price": "Free",
"ppu_price": "0.15",
"allow_multiple": true,
"is_readonly": false,
"metadata_labels": "",
"data": "{\"html\": \"\"}",
"default_data": ""
},
"data": {
},
"order": 1,
"metadata": {
},
"is_archived": false,
"date_updated": "2020-02-10T03:02:27.029364Z",
"date_created": "2020-02-10T03:02:27.026207Z",
"updated_by": "xxx",
"change_permission": true
}
响应: 406
Error: missing table__sid
Error: The table (xxx) does not belong to the organization (xxx).
Error: Wrong row sid!
Error: The row (xxx) does not belong to the organization (xxx).
Error: Wrong widget sid!
Your organization does not have enough credits, contact sales@labii.com!
Error: You can not add multiple xxx widget per record.
获取章节详情
端点: /tables/section/detail/{sid}/
参数: sid (路径, 字符串)
参数: token (头部, 字符串)
响应: 200
{
"sid": "xxx",
"table": {
"sid": "xxx",
"name": "experiments"
},
"row": null,
"name": "Overview",
"description": "The short description of the experiment",
"widget": {
"sid": "xxx",
"icon": "format_color_text",
"name": "Rich Text (CKEditor Classic)",
"category": "Office",
"sub_category": "Text, Word, Docs",
"company": "Labii Inc.",
"notes": "Smart WYSIWYG HTML editor",
"description": "CKEditor is a WYSIWYG rich text editor which enables writing content directly inside of web pages or online applications. Its core code is written in JavaScript and it is developed by CKSource.",
"documentation_url": "https://docs.labii.com/widgets/office/text#rich-text-ckeditor-classic",
"usecase": "Protocol Steps; Experiment Overview; Descriptional Result;",
"type": "Section",
"constructor": "object",
"related_to": "Rich Text (CKEditor Balloon), Rich Text (Draft.js - deprecated), Plain Text, Google Docs, Microsoft Word, Microsoft Word (Personal), Microsoft Word (Business)",
"version": "1.00",
"release_date": "2020-04-19",
"order": "2.00",
"subscription_price": "Free",
"ppu_price": "0.15",
"allow_multiple": true,
"is_readonly": false,
"metadata_labels": "",
"data": "{\"html\": \"\"}",
"default_data": ""
},
"data": {
},
"order": 1,
"metadata": {
},
"is_archived": false,
"date_updated": "2020-02-10T03:02:27.029364Z",
"date_created": "2020-02-10T03:02:27.026207Z",
"updated_by": "xxx",
"change_permission": true
}
修改章节
端点: /tables/section/detail/{sid}/
参数: sid (路径, 字符串)
参数: token (头部, 字符串)
参数: name (正文, 字符串)
参数: description (正文, 字符串)
参数: order (正文, 数字)
参数: data (正文, 对象)
参数: is_archived (正文, 布尔)
响应: 200
{
"sid": "xxx",
"table": {
"sid": "xxx",
"name": "experiments"
},
"row": null,
"name": "Overview",
"description": "The short description of the experiment",
"widget": {
"sid": "xxx",
"icon": "format_color_text",
"name": "Rich Text (CKEditor Classic)",
"category": "Office",
"sub_category": "Text, Word, Docs",
"company": "Labii Inc.",
"notes": "Smart WYSIWYG HTML editor",
"description": "CKEditor is a WYSIWYG rich text editor which enables writing content directly inside of web pages or online applications. Its core code is written in JavaScript and it is developed by CKSource.",
"documentation_url": "https://docs.labii.com/widgets/office/text#rich-text-ckeditor-classic",
"usecase": "Protocol Steps; Experiment Overview; Descriptional Result;",
"type": "Section",
"constructor": "object",
"related_to": "Rich Text (CKEditor Balloon), Rich Text (Draft.js - deprecated), Plain Text, Google Docs, Microsoft Word, Microsoft Word (Personal), Microsoft Word (Business)",
"version": "1.00",
"release_date": "2020-04-19",
"order": "2.00",
"subscription_price": "Free",
"ppu_price": "0.15",
"allow_multiple": true,
"is_readonly": false,
"metadata_labels": "",
"data": "{\"html\": \"\"}",
"default_data": ""
},
"data": {
},
"order": 1,
"metadata": {
},
"is_archived": false,
"date_updated": "2020-02-10T03:02:27.029364Z",
"date_created": "2020-02-10T03:02:27.026207Z",
"updated_by": "xxx",
"change_permission": true
}