Bundle: publish

Bundle: publish

出版该本书。

Request

HTTP request

POST https://www.featapi.com/api/dimzou/bundle/{id}/publish/

Parameters

  • Path parameters
Parameter nameValueDescription
idstring出版的bundle id

授权

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

Scopes
dimzou_bundle

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

Request body

Property nameValueDescriptionNotes
Required Properties
nodeslist[string]提交出版的章节id的列表
category_idinteger出版后的出版物分类
Optional Properties
extra_info_<type>json额外保存的出版信息。<type>替换成信息类型,长度不超过20个字符。值为任意json类型。如欲保存图片可直接保存dataurl。如:
extra_info_card_v1: {
"_base": {
"cover": "data:image/png;base64,iVBORw..."
},
"X": {
"title": "some title"
}
}
restrictedbool
list[uid]
限制可访问出版物的人,默认为false,即不限制。
为true时自动使用协作者名单作为可访问者名单。
为uid数组时,使用该组uid作为可访问者名单,如作者不在名单里,会自动加入。

Response

如果成功,则此方法在响应正文中返回 Dimzou.publication 资源。

200 出版成功

{
    "data": [
        {
            "id": 2113,
            "node_id": 7853,
            "bundle_id": 7686,
            "title": "Feat助手(Party)需求",
            "summary": "<p>Feat助手(Party)需求</p>",
            "content": "<p>测试</p>",
            "cover": "https://10.0.10.117:8003/media/3616060330793/dimzou/reword/300/20200323_5D42B02_cover.png",
            "sort": 1,
            "author": {
                "uid": 3616060330793,
                "avatar": "https://10.0.10.117:8003/media/3616060330793/avatar/blob_uB5ZFNh",
                "expertise": "弹钢琴",
                "firstname": "zetong",
                "lastname": "lin",
                "username": "zetong lin",
                "timezone": "Asia/Shanghai",
                "timezone_utc_offset": "+08:00",
                "online": true,
                "location": "CHN",
                "avatars": {
                    "path": "https://10.0.10.117:8003/media/3616060330793/avatar/blob_uB5ZFNh",
                    "sizes": {
                        "sm": {
                            "width": 32,
                            "height": 32,
                            "path": "https://10.0.10.117:8003/media/sm/3616060330793/avatar/blob_uB5ZFNh_32x32.JPEG" 
                        },
                        "md": {
                            "width": 64,
                            "height": 64,
                            "path": "https://10.0.10.117:8003/media/md/3616060330793/avatar/blob_uB5ZFNh_64x64.JPEG" 
                        },
                        "lg": {
                            "width": 300,
                            "height": 300,
                            "path": "https://10.0.10.117:8003/media/lg/3616060330793/avatar/blob_uB5ZFNh_300x300.JPEG" 
                        } 
                    } 
                } 
            },
            "translator": null,
            "category": {
                "id": 3,
                "name": "Natural Science",
                "parent_id": 2,
                "kind": "category",
                "slug": "natural-science",
                "approved_at": "2019-07-17T06:29:34.683000Z",
                "created_at": "2019-05-08T06:29:32.115000Z",
                "deleted_at": null 
            },
            "created_at": "2020-03-23T06:16:34.495123Z",
            "updated_at": "2020-03-23T06:16:34.495553Z",
            "nodes": [
                {
                    "id": 7853,
                    "node_type": 0,
                    "text_title": "Feat助手(Party)需求",
                    "text_summary": "Feat助手(Party)需求",
                    "sort": 1,
                    "created_at": "2019-12-06T02:19:51.399382Z",
                    "updated_at": "2020-03-23T06:16:34.492917Z",
                    "status": 100,
                    "is_deleted": false,
                    "visibility": true,
                    "node_publish_time": "2020-03-23T06:16:34.495123Z",
                    "manuscript": null 
                }],
            "pub_type": 0,
            "comments_count": 0,
            "likes_count": 0,
            "current_user_has_liked": false,
            "template": "I",
            "covers": {
                "path": "https://10.0.10.117:8003/media/3616060330793/dimzou/reword/300/20200323_5D42B02_cover.png",
                "sizes": {
                    "cover_sm": {
                        "width": 300,
                        "height": 300,
                        "path": "https://10.0.10.117:8003/media/cover_sm/3616060330793/dimzou/reword/300/20200323_5D42B02_cover_300x300.JPEG" 
                    } 
                } 
            },
            "bundle_is_multi_chapter": false,
            "is_binding_publish": false,
            "is_all_chapters_publish": true,
            "comments": [
            ],
            "bundle_original": null,
            "bundle_copy_creator": null 
        }] 
}

400 验证失败,不能出版

{
    "error": true,
    "message": null,
    "code": "VALIDATION_EXCEPTION",
    "data": {
        "errors": {
            "{Node ID}": {
                "content": "Content is empty." 
            },
            "{Node ID}": {
                "title": "Cover Chapter Title is empty.",
                "summary": "Cover Chapter Summary is empty." 
            } 
        } 
    } 
}

发表评论

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

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

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

Captcha Code