获取 Doc 文档内容

... 2022-7-14 大约 3 分钟

# 获取 Doc 文档内容

# 接口说明

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

# 权限说明

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

  • scope.doc
  • scope.doc.readonly

# 请求

描述 定义
Path /openapi/doc/v3/{fileId}
Method GET
Accept application/json

# 请求头部

详见Headers

# 请求参数

# 路径参数

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

# 查询参数

# 请求体

# 响应

# 响应体

参数名 类型 描述
document object(document) 文档内容,详见document
version integer 文档版本

# 示例

# 请求示例

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

# 响应示例

{
    "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
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258

# 错误码

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

查询更多业务返回码

上次编辑于: 2023年5月31日 11:27
贡献者: mylochen , livlin , muyanyang