企业微信(WeCom)-办公 icon

企业微信(WeCom)-办公

企业微信办公功能 - 文档、微盘、邮件、日程、待办、会议、直播、打卡、审批、汇报、人事、会议室、紧急通知、公费电话

Actions298

文档 → [智能文档] 添加内容块

AI-generated

Summary

Add a block to a smart document

Inputs

  • wedocPermissionNotice — 需要将应用配置到「协作 - 文档 - 可调用接口的应用」。
  • docid (required) — 智能文档的 docid,可通过“新建文档”(文档类型选智能文档)获得
  • page_id (required) — 可通过“获取页面结构”获得
  • blocks_json (required) — BlockInfo 数组:type 必填,可选 title、parent_id、after_id、children、props。官方文档

Output shape

a JSON response indicating success or failure; on success the body may be empty or contain the updated block information

The exact response shape varies; failures include an error object, while successful calls may return no body or the refreshed block list.

Examples

Example 1: Add a simple text block to a smart document

docid: "12345", page_id: "page_6789", blocks_json: '[{"type":"BLOCK_TYPE_TEXT","title":"Hello World"}]'

Example 2: Add a rich text block with formatting

docid: "doc_abc", page_id: "page_def", blocks_json: '[{"type":"BLOCK_TYPE_TEXT","title":"Important","props":{"text":"Rich content"}}]'

Example 3: Add multiple blocks in one call

docid: "DOC_ID", page_id: "PAGE_ID", blocks_json: '[{"type":"BLOCK_TYPE_TEXT","title":"Step 1"},{"type":"BLOCK_TYPE_IMAGE","url":"https://example.com/img.png"}]'

Links

Discussion