wecomcli-sheet
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese企业微信在线表格管理
WeCom Online Sheet Management
是企业微信提供的命令行程序,所有操作通过执行wecom-cli命令完成。wecom-cli
资源型技能,负责在线表格()的新建、内容读写以及子工作表管理。
/sheet/*is a command-line program provided by WeCom, all operations are completed by executingwecom-clicommands.wecom-cli
This is a resource-based skill responsible for creating, reading/writing content, and managing sub-sheets of Online Sheets ().
/sheet/*调用方式
Calling Method
通过 调用,品类为 :
wecom-clidocbash
wecom-cli doc <tool_name> '<json_params>'Call via , category is :
wecom-clidocbash
wecom-cli doc <tool_name> '<json_params>'接口路由表
Interface Routing Table
硬规则:第二列是链接的,命中这一行后先references/xxx.md对应 references 文件,再构造命令。写入/读取子表数据前,先用read拿到目标子表的sheet_get_info。sheet_id
| 用户意图 | 参考位置 |
|---|---|
| 读取在线表格完整内容(Markdown 概览) | 见下方「读取完整内容」 |
| 读取在线表格基础信息与子表列表 | 见下方「读取基础信息」 |
| 从零新建在线表格(空白) | 见下方「新建在线表格」 |
| 修改在线表格指定区域内容 | references/sheet-update-range-data.md |
| 在线表格末尾追加一行数据 | references/sheet-append-data.md |
| 添加在线表格子工作表 | references/sheet-add-sub.md |
| 删除在线表格子工作表 | references/sheet-delete-sub.md |
Hard Rule: If the second column is a link to, after hitting this row, firstreferences/xxx.mdthe corresponding references file, then construct the command. Before writing/reading sub-sheet data, usereadto get thesheet_get_infoof the target sub-sheet first.sheet_id
| User Intent | Reference Location |
|---|---|
| Read complete content of Online Sheet (Markdown overview) | See "Read Complete Content" below |
| Read basic information and sub-sheet list of Online Sheet | See "Read Basic Information" below |
| Create an Online Sheet from scratch (blank) | See "Create Online Sheet" below |
| Modify content in specified range of Online Sheet | references/sheet-update-range-data.md |
| Append a row of data at the end of Online Sheet | references/sheet-append-data.md |
| Add sub-sheet to Online Sheet | references/sheet-add-sub.md |
| Delete sub-sheet from Online Sheet | references/sheet-delete-sub.md |
接口详述
Interface Details
新建在线表格
Create Online Sheet
从零新建一篇企微在线表格:空白。创建成功后返回 和 。
docidurl命令
bash
wecom-cli doc create_doc '<JSON 参数>'参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| int | 是 | — | 固定传 |
| string | 是 | — | 表格标题 |
注意事项
- 本接口仅创建空白在线表格,不支持携带初始内容;如需写入数据,请在创建后先用 拿到子表
sheet_get_info,再通过sheet_id/sheet_update_range_data写入。sheet_append_data
Create a blank WeCom Online Sheet from scratch. Returns and after successful creation.
docidurlCommand
bash
wecom-cli doc create_doc '<JSON parameters>'Parameters
| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
| int | Yes | — | Fixed value |
| string | Yes | — | Sheet title |
Notes
- This interface only creates blank online sheets, and does not support carrying initial content; if you need to write data, after creation, first use to get the sub-sheet
sheet_get_info, then write viasheet_id/sheet_update_range_data.sheet_append_data
读取完整内容
Read Complete Content
获取在线表格的完整内容数据,统一以 Markdown 格式返回。采用异步轮询机制:首次调用无需传 ,接口返回 ;若 为 ,需携带该 再次调用,直到 为 时返回完整内容。适合快速概览或读取整篇表格内容。
task_idtask_idtask_donefalsetask_idtask_donetrue命令
bash
wecom-cli doc get_doc_content '<JSON 参数>'参数
| 字段 | 类型 | 必填 | 默认值 | 语义 |
|---|---|---|---|---|
| string | 与 | — | 在线表格的 docid |
| string | 与 | — | 在线表格的访问链接 |
| int | 是 | — | 内容返回格式,固定传 |
| string | 否 | — | 任务 ID,首次不传,轮询时填上次返回的 |
返回
| 字段 | 类型 | 说明 |
|---|---|---|
| string | |
| string | 任务 ID,未完成时用于下次轮询 |
| bool | 任务是否完成, |
使用规则
- 首次调用不传 ;若
task_id为task_done,记录false后携带其再次调用,直到task_id为task_done取true。content
Obtain the complete content data of the Online Sheet, returned uniformly in Markdown format. Uses asynchronous polling mechanism: No need to pass for the first call, the interface returns ; if is , carry this to call again until is , then the complete content is returned. Suitable for quick overview or reading the entire sheet content.
task_idtask_idtask_donefalsetask_idtask_donetrueCommand
bash
wecom-cli doc get_doc_content '<JSON parameters>'Parameters
| Field | Type | Required | Default Value | Semantics |
|---|---|---|---|---|
| string | Either | — | docid of the Online Sheet |
| string | Either | — | Access link of the Online Sheet |
| int | Yes | — | Content return format, fixed value |
| string | No | — | Task ID, not passed for the first call, fill in the |
Return
| Field | Type | Description |
|---|---|---|
| string | Complete Markdown content returned when |
| string | Task ID, used for next polling when not completed |
| bool | Whether the task is completed; when |
Usage Rules
- Do not pass for the first call; if
task_idistask_done, record thefalseand carry it to call again untiltask_idistask_doneto retrievetrue.content
读取基础信息
Read Basic Information
读取在线表格的基础信息,包括工作表列表、文档名称与访问链接。所有后续需要 的接口( / / 等)的 都从本接口返回的 中取。
sheet_idsheet_update_range_datasheet_append_datasheet_delete_subsheet_idsheets[]命令
bash
wecom-cli doc sheet_get_info '<JSON 参数>'参数
| 字段 | 类型 | 必填 | 默认值 | 语义 |
|---|---|---|---|---|
| string | 与 | — | 在线表格的 docid |
| string | 与 | — | 在线表格的访问链接 |
返回
| 字段 | 类型 | 说明 |
|---|---|---|
| array | 工作表列表;每项含 |
| string | 文档访问链接 |
| string | 文档名称 |
使用规则
- 与
docid二选一,至少传其一。url - 读 → 写 链路:当需要往具体子表写内容(/
sheet_update_range_data)时,应先用sheet_append_data读取并识别出各子表的标题与具体数据,再调用本接口拿到get_doc_content中每个子表的sheets[]与行列数(sheet_id/row_count);通过子表标题与column_count匹配确定目标title,并结合行列数核对写入区域范围,从而打通「读 → 写」的完整链路。sheet_id
Read the basic information of the Online Sheet, including the list of worksheets, document name and access link. The of all subsequent interfaces that require (such as / / ) is obtained from the returned by this interface.
sheet_idsheet_idsheet_update_range_datasheet_append_datasheet_delete_subsheets[]Command
bash
wecom-cli doc sheet_get_info '<JSON parameters>'Parameters
| Field | Type | Required | Default Value | Semantics |
|---|---|---|---|---|
| string | Either | — | docid of the Online Sheet |
| string | Either | — | Access link of the Online Sheet |
Return
| Field | Type | Description |
|---|---|---|
| array | List of worksheets; each item contains basic information such as |
| string | Document access link |
| string | Document name |
Usage Rules
- Either or
docidis required, at least one must be passed.url - Read → Write Link: When you need to write content to a specific sub-sheet (/
sheet_update_range_data), you should first usesheet_append_datato read and identify the title and specific data of each sub-sheet, then call this interface to get theget_doc_contentand row/column counts (sheet_id/row_count) of each sub-sheet incolumn_count; determine the targetsheets[]by matching the sub-sheet title withsheet_id, and check the write area range combined with the row/column counts, thus opening up the complete "Read → Write" link.title
跨技能依赖
Cross-Skill Dependencies
| 依赖技能 | 典型协作场景 | 数据流向 |
|---|---|---|
| 表格里需要写入人员信息时按姓名查 userid | |
| 用户要求把在线表格链接发给某人/某群 | 本 skill 新建后返回 |
| Dependent Skill | Typical Collaboration Scenario | Data Flow |
|---|---|---|
| When personnel information needs to be written into the sheet, query userid by name | |
| When the user requests to send the Online Sheet link to someone/some group | This skill returns |