工具 API

doc.resolve_document_structure

获取文档结构树(DOC),返回扁平节点列表,用于在调用需要 idx/index/ranges 的写类工具前定位位置。节点 type:Paragraph / Heading(heading_level 1..9)/ Title / Subtitle / Table;文字下划线/删除线/高亮通过 has_highlights 标志位 + highlight_spans 嵌入在 Paragraph 内.paragraph_index(全局 1-based 节点序号)标注第几段(含标题)。三档 mode(默认 compact):outline=只给标题出 preview,骨架级;compact=每节点 10 字符 preview + has_highlights / row_count×col_count / children_count / is_numbering 等轻量信号位;full=highlight_spans / table cells / numbering 详情全部回填。定位单段传 idx(自动按 full 回包,跳过分页);超长文档用 offset/limit 分页(默认 limit=150)。

productivityOAuth1 积分

调用信息

工具标识
tencent-docs.doc.resolve_document_structure
服务提供方
腾讯文档
平均响应
0 ms
近 7 天调用
0

输入参数

file_id

在线文档DOC的文档唯一标识符(与file_url二选一)

file_url

腾讯文档的URL链接(推荐),与file_id二选一

has_idx

idx是否显式传入

has_text_preview_length

text_preview_length 是否显式传入(区分「未设置」与「设为0」)

idx

可选,传入字符位置索引,只返回包含该位置的块的结构信息

include_highlights

是否返回 highlight_spans(mode==full 时无论此值都返回)

include_table_cells

是否返回表格内单元格详情(mode==full 时无论此值都返回)

include_textbox_children

是否返回文本框子节点(mode==full 时无论此值都返回)

limit

顶层节点数组分页条数;0=不限(has_idx==true 时忽略);默认150

mode

详细程度模式:0=outline(只给标题出preview,骨架级);1=compact(默认,每节点10字符preview + has_highlights/row_count×col_count/children_count/is_numbering等轻量信号位);2=full(highlight_spans/table cells/numbering详情全部回填)

offset

顶层节点数组分页偏移(has_idx==true 时忽略)

text_preview_length

text_preview 字符上限;0=不返回预览;负数或不传=使用 mode 默认值

version_info

版本参数