企业微信(WeCom)-基础 icon

企业微信(WeCom)-基础

企业微信基础功能 - 通讯录、应用消息、群聊、消息推送、企业互联、素材、系统、电子发票、第三方应用授权、接口调用许可、收银台、对外收款、小程序对外收款、企业红包/向员工付款、数据与智能专区、会话内容存档、推广二维码、账号ID、安全管理

Actions248

通讯录管理 → [部门管理] 获取部门列表

AI-generated

Summary

Retrieves WeCom departments using the credentials’ authorized scope. Leave Department empty to fetch the full organization structure, or provide a department ID to fetch that department and all of its descendants recursively.

Inputs

  • Department (id) — Optional department ID, selectable from the list or supplied as an expression. When set, limits the result to that department and its descendants; when omitted, requests the full organization structure. Results are limited to departments the credential’s application can access.

Output shape

A list of department records returned by the WeCom API.

The source pack shows the operation wiring but not the request or response body details. WeCom notes that this endpoint may be unavailable to IPs newly added to Contact Sync after 2022-08-15 10:00, and recommends the department ID list, child department ID list, or single department detail endpoints for better performance.

Examples

Example 1: Get the full organization structure

Leave Department empty to fetch all departments in the application’s authorized scope.

Example 2: Get one department and its descendants

Select or enter a department ID to fetch that department and all nested child departments.

Links

Discussion