Wechat Work Node icon

Wechat Work Node

Wechat Work Node

部门管理 → 获取子部门ID列表

AI-generated

Summary

Retrieve the list of IDs for the specified department and all its sub-departments recursively. If no department ID is provided, fetch the entire organizational structure's department IDs.

Inputs

  • 部门ID — The ID of the department whose sub-departments (including nested sub-departments recursively) will be retrieved. If not specified, the operation returns the full set of department IDs representing the entire organization structure.

Output shape

a JSON object containing a list of department IDs representing the specified department and its recursive sub-departments, or all departments if no ID is given.

The operation performs an authenticated GET request to the Wechat Work API endpoint /cgi-bin/department/simplelist with an optional id query parameter. The response includes department IDs in a JSON structure. Errors throw a NodeOperationError with Wechat Work error codes and messages.

Links

Discussion