插入一个段落。
Request
HTTP request
POST https://www.featapi.com/api/dimzou/bundle/{id}/insert-paragraph/
Parameters
- Path parameters
Parameter name | Value | Description |
---|---|---|
id | string | Bundle(book) ID |
- Query parameters
Parameter name | Value | Description |
---|---|---|
Required parameters | ||
node | string | 章节id |
授权
此请求需要具有以下所有范围的授权:
Scopes |
---|
dimzou_bundle |
有关更多信息,请参阅认证和授权页面。
Request body
在请求体中,提供具有以下属性的 Dimzou.reword 资源:
Property name | Value | Description | Notes |
---|---|---|---|
Required Properties | |||
content | string | 段落内容 | 纯文本 |
html_content | string | 段落内容HTML文本 | HTML文本 |
content_meta | nested object | 段落内容HTML文本的megadraft数据,供前端展示 | 详见 http://megadraft.io/ |
Optional Properties | |||
paragraph_id | integer | 段落ID,新的段落插在该段落ID后面; 不提交则在最后添加新段落 | Dimzou.Paragraph |
img | file | 段落为图片 | |
file | file | 段落为文件 | |
file_info | nested object | 文件信息 | |
media_type | enum | 媒体类型 | Reword.MediaType, 默认是Text |
is_first | string | 与paragraph_id互斥,如果新段落要插在第一段落则为true(并且不提交paragraph_id),否则为false |
Response
如果成功,则此方法在响应正文中返回 Dimzou.paragraph & Dimzou.reword 资源。
201 成功插入段落
{
"data": [
{
"id": 3984704,
"sort": 8,
"info": null,
"node_id": 108111,
"rewordings": [
{
"id": 2961772,
"user": {
"uid": 4416382589854,
"avatar": "https://pic1.feat.com/media/storage/avatars/MMcSjXJmfdTptMBgmCBvvDOaXHcgGfdcXLzMP405.jpeg",
"expertise": "理发",
"firstname": "zetong",
"lastname": "lin",
"username": "zetong lin",
"timezone": "Asia/Shanghai",
"timezone_utc_offset": "+08:00",
"online": false,
"location": "CHN",
"avatars": {
"path": "https://pic1.feat.com/media/storage/avatars/MMcSjXJmfdTptMBgmCBvvDOaXHcgGfdcXLzMP405.jpeg",
"sizes": {
"sm": {
"width": 32,
"height": 32,
"path": "https://pic1.feat.com/media/sm/storage/avatars/MMcSjXJmfdTptMBgmCBvvDOaXHcgGfdcXLzMP405_32x32.JPEG"
},
"md": {
"width": 64,
"height": 64,
"path": "https://pic1.feat.com/media/md/storage/avatars/MMcSjXJmfdTptMBgmCBvvDOaXHcgGfdcXLzMP405_64x64.JPEG"
},
"lg": {
"width": 300,
"height": 300,
"path": "https://pic1.feat.com/media/lg/storage/avatars/MMcSjXJmfdTptMBgmCBvvDOaXHcgGfdcXLzMP405_300x300.JPEG"
}
}
}
},
"type": 200,
"content": "插入段落",
"html_content": "<p>插入段落</p>",
"img": null,
"imgs": {},
"crop_img": null,
"crop_imgs": {},
"status": 100,
"version": 1,
"last_modified": "2020-03-23T02:30:53.368257Z",
"create_time": "2020-03-23T02:30:53.360569Z",
"is_selected": true,
"content_meta": {
"blocks": [
{
"key": "4cuc0",
"data": {
},
"text": "插入段落",
"type": "unstyled",
"depth": 0,
"entityRanges": [
],
"inlineStyleRanges": [
]
}],
"entityMap": {
}
},
"base_on": null,
"comments_count": 0,
"likes_count": 0,
"template_config": null,
"media_type": 0,
"img_height": null,
"img_width": null,
"file": null,
"file_info": null,
"submit_version": 1,
"comments": [],
"version_lock": false
}]
}]
}
400 Submitted data error
示例返回数据可参考 API Common – Validation Exception
401 Permission Deny
示例返回数据可参考 API Common – Authorization Failed