Bundle: insertParagraph

Bundle: insertParagraph

插入一个段落。

Request

HTTP request

POST https://www.featapi.com/api/dimzou/bundle/{id}/insert-paragraph/

Parameters

  • Path parameters
Parameter nameValueDescription
idstringBundle(book) ID
  • Query parameters
Parameter nameValueDescription
Required parameters
nodestring章节id

授权

此请求需要具有以下所有范围的授权:

Scopes
dimzou_bundle

有关更多信息,请参阅认证和授权页面。

Request body

在请求体中,提供具有以下属性的 Dimzou.reword 资源:

Property nameValueDescriptionNotes
Required Properties
contentstring段落内容纯文本
html_contentstring段落内容HTML文本HTML文本
content_metanested object段落内容HTML文本的megadraft数据,供前端展示详见 http://megadraft.io/
Optional Properties
paragraph_idinteger段落ID,新的段落插在该段落ID后面; 不提交则在最后添加新段落Dimzou.Paragraph
imgfile段落为图片
filefile段落为文件
file_infonested object文件信息
media_typeenum媒体类型Reword.MediaType, 默认是Text
is_firststring与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

发表评论

您的电子邮箱地址不会被公开。

您可以使用以下 HTML标签和属性:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Captcha Code