directory
feishu.contact.directory
¶
OrganizationSnapshot
dataclass
¶
Raw organization-directory facts returned by Feishu.
departments contains the descendants returned from the root department;
users contains one raw user record for each stable Feishu identity found
across the root and descendant departments. The SDK neither filters nor
derives account information from email addresses.
源代码位于: feishu/contact/directory.py
fetch_organization_snapshot
async
¶
fetch_organization_snapshot(client: Any, *, root_department_id: str = '0', page_size: int = 50, max_items: int | None = None) -> OrganizationSnapshot
Fetch raw departments and de-duplicated user facts for an organization.
The root department’s descendants are fetched once through
client.contact.departments.list. Users are then listed for the root and
every discovered department. user_id is requested and used as the
canonical stable identity; open_id and union_id are only fallbacks
when an API response lacks user_id.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
|
Any
|
A Feishu client exposing the existing contact namespaces. |
必需 |
|
str
|
Root department ID. Defaults to the Feishu root,
|
'0'
|
|
int
|
Page size passed to the existing contact APIs. |
50
|
|
int | None
|
Optional maximum passed to the existing contact APIs. |
None
|
返回:
| 类型 | 描述 |
|---|---|
OrganizationSnapshot
|
An [OrganizationSnapshot][] containing raw Feishu department and user |
OrganizationSnapshot
|
facts. User records are ordered by their stable Feishu identity. |