返回介绍

获取 Doc 文档内容 v3

发布于 2023-04-06 17:51:15 字数 18013 浏览 0 评论 0 收藏 0

fileID 150

接口说明

本接口用于获取 Doc 文档内容

权限说明

本接口需要拥有以下任意一项权限:

  • scope.doc
  • scope.doc.readonly

请求

描述定义
Path/openapi/doc/v3/{fileId}
MethodGET
Acceptapplication/json

请求头部

详见Headers

请求参数

路径参数

参数名类型必选描述
fileIdstring文档唯一标识,详见fileId

查询参数

请求体

响应

响应体

参数名类型描述
documentobject(document)文档内容,详见document
versioninteger文档版本

示例

请求示例

curl --location --request PUT 'https://docs.qq.com/openapi/doc/v3/300000000$AAAAAAAAAAAA' \
--header 'Access-Token: ACCESS_TOKEN' \
--header 'Client-Id: CLIENT_ID' \
--header 'Open-Id: OPEN_ID'

响应示例

{
    "document": {
        "begin": 0,
        "end": 14,
        "type": "Document",
        "children": [
            {
                "begin": 0,
                "end": 8,
                "type": "MainStory",
                "children": [
                    {
                        "begin": 0,
                        "end": 7,
                        "type": "Section",
                        "children": [
                            {
                                "begin": 0,
                                "end": 1,
                                "type": "Paragraph",
                                "children": [],
                                "text": "",
                                "property": {
                                    "sectionProperty": null,
                                    "paragraphProperty": {
                                        "numberProperty": {
                                            "nestingLevel": 0,
                                            "numberId": ""
                                        },
                                        "spacing": {
                                            "before": 0,
                                            "after": 0,
                                            "line": 0,
                                            "lineRule": "LineSpacingRule_PBDEFAULT"
                                        },
                                        "indent": {
                                            "left": 0,
                                            "leftChars": 0,
                                            "right": 0,
                                            "rightChars": 0,
                                            "hanging": 0,
                                            "hangingChars": 0,
                                            "firstLine": 0,
                                            "firstLineChars": 0
                                        },
                                        "alignmentType": "AlignmentType_PBDEFAULT",
                                        "textDirection": "TextDirection_PBDEFAULT"
                                    },
                                    "runProperty": null,
                                    "tableProperty": null,
                                    "tableRowProperty": null,
                                    "tableCellProperty": null,
                                    "textBoxProperty": null,
                                    "drawingProperty": null,
                                    "commentStoryProperty": null,
                                    "makeupProperty": null,
                                    "footnoteProperty": null,
                                    "endnoteProperty": null,
                                    "footnoteOrEndnoteReferenceProperty": null,
                                    "headerProperty": null,
                                    "footerProperty": null
                                },
                                "meta": null
                            },
                            {
                                "begin": 1,
                                "end": 6,
                                "type": "Paragraph",
                                "children": [
                                    {
                                        "begin": 1,
                                        "end": 5,
                                        "type": "Run",
                                        "children": [
                                            {
                                                "begin": 1,
                                                "end": 5,
                                                "type": "Text",
                                                "children": [],
                                                "text": "test",
                                                "property": {
                                                    "sectionProperty": null,
                                                    "paragraphProperty": null,
                                                    "runProperty": null,
                                                    "tableProperty": null,
                                                    "tableRowProperty": null,
                                                    "tableCellProperty": null,
                                                    "textBoxProperty": null,
                                                    "drawingProperty": null,
                                                    "commentStoryProperty": null,
                                                    "makeupProperty": null,
                                                    "footnoteProperty": null,
                                                    "endnoteProperty": null,
                                                    "footnoteOrEndnoteReferenceProperty": null,
                                                    "headerProperty": null,
                                                    "footerProperty": null
                                                },
                                                "meta": null
                                            }
                                        ],
                                        "text": "",
                                        "property": {
                                            "sectionProperty": null,
                                            "paragraphProperty": null,
                                            "runProperty": {
                                                "font": "",
                                                "bold": false,
                                                "italics": false,
                                                "underline": false,
                                                "strike": false,
                                                "color": "",
                                                "spacing": 0,
                                                "size": 0,
                                                "shading": {
                                                    "foregroundColor": "",
                                                    "backgroundColor": ""
                                                },
                                                "verticalAlign": "RUN_VERTICAL_ALIGN_UNSPECIFIED",
                                                "isPlaceholder": false
                                            },
                                            "tableProperty": null,
                                            "tableRowProperty": null,
                                            "tableCellProperty": null,
                                            "textBoxProperty": null,
                                            "drawingProperty": null,
                                            "commentStoryProperty": null,
                                            "makeupProperty": null,
                                            "footnoteProperty": null,
                                            "endnoteProperty": null,
                                            "footnoteOrEndnoteReferenceProperty": null,
                                            "headerProperty": null,
                                            "footerProperty": null
                                        },
                                        "meta": null
                                    }
                                ],
                                "text": "",
                                "property": {
                                    "sectionProperty": null,
                                    "paragraphProperty": {
                                        "numberProperty": {
                                            "nestingLevel": 0,
                                            "numberId": ""
                                        },
                                        "spacing": {
                                            "before": 0,
                                            "after": 0,
                                            "line": 20.8,
                                            "lineRule": "LineSpacingRule_auto"
                                        },
                                        "indent": {
                                            "left": 0,
                                            "leftChars": 0,
                                            "right": 0,
                                            "rightChars": 0,
                                            "hanging": 0,
                                            "hangingChars": 0,
                                            "firstLine": 0,
                                            "firstLineChars": 0
                                        },
                                        "alignmentType": "AlignmentType_PBDEFAULT",
                                        "textDirection": "TextDirection_PBDEFAULT"
                                    },
                                    "runProperty": null,
                                    "tableProperty": null,
                                    "tableRowProperty": null,
                                    "tableCellProperty": null,
                                    "textBoxProperty": null,
                                    "drawingProperty": null,
                                    "commentStoryProperty": null,
                                    "makeupProperty": null,
                                    "footnoteProperty": null,
                                    "endnoteProperty": null,
                                    "footnoteOrEndnoteReferenceProperty": null,
                                    "headerProperty": null,
                                    "footerProperty": null
                                },
                                "meta": null
                            }
                        ],
                        "text": "",
                        "property": {
                            "sectionProperty": {
                                "headerReference": {},
                                "footerReference": {},
                                "pageSize": {
                                    "width": 793.6666666666666,
                                    "height": 1122.5333333333333,
                                    "orientation": "PAGE_ORIENTATION_UNSPECIFIED"
                                },
                                "pageMargins": {
                                    "top": 90.73333333333333,
                                    "right": 94.46666666666667,
                                    "bottom": 90.73333333333333,
                                    "left": 94.46666666666667
                                }
                            },
                            "paragraphProperty": null,
                            "runProperty": null,
                            "tableProperty": null,
                            "tableRowProperty": null,
                            "tableCellProperty": null,
                            "textBoxProperty": null,
                            "drawingProperty": null,
                            "commentStoryProperty": null,
                            "makeupProperty": null,
                            "footnoteProperty": null,
                            "endnoteProperty": null,
                            "footnoteOrEndnoteReferenceProperty": null,
                            "headerProperty": null,
                            "footerProperty": null
                        },
                        "meta": null
                    }
                ],
                "text": "",
                "property": {
                    "sectionProperty": null,
                    "paragraphProperty": null,
                    "runProperty": null,
                    "tableProperty": null,
                    "tableRowProperty": null,
                    "tableCellProperty": null,
                    "textBoxProperty": null,
                    "drawingProperty": null,
                    "commentStoryProperty": null,
                    "makeupProperty": null,
                    "footnoteProperty": null,
                    "endnoteProperty": null,
                    "footnoteOrEndnoteReferenceProperty": null,
                    "headerProperty": null,
                    "footerProperty": null
                },
                "meta": null
            }
        ],
        "text": "",
        "property": {
            "sectionProperty": null,
            "paragraphProperty": null,
            "runProperty": null,
            "tableProperty": null,
            "tableRowProperty": null,
            "tableCellProperty": null,
            "textBoxProperty": null,
            "drawingProperty": null,
            "commentStoryProperty": null,
            "makeupProperty": null,
            "footnoteProperty": null,
            "endnoteProperty": null,
            "footnoteOrEndnoteReferenceProperty": null,
            "headerProperty": null,
            "footerProperty": null
        },
        "meta": null
    },
    "version": 4
}

错误码

HTTP 状态码业务错误码描述排查建议
400400001请求参数错误确认传入的参数是否合法
429400007请求数超过限制请求数超过限频,请降低调用频率
500400010服务内部错误服务端错误,请联系开发者

查询更多业务返回码

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文