events
feishu.mail.events
¶
EventsNamespace
¶
Bases: Namespace
邮箱事件订阅命名空间。
通过 client.mail.events 访问,封装飞书邮箱事件订阅与取消订阅接口。该接口通常需要
feishu.client.FeishuClient.as_user 派生的用户身份调用。
飞书文档
源代码位于: feishu/mail/events.py
subscribe
async
¶
Python
subscribe(user_mailbox_id: str, *, event_type: int = 1) -> NestedDict
订阅指定用户邮箱的邮件相关事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
|
str
|
用户邮箱地址,或用户态调用时的 |
必需 |
|
int
|
事件类型,飞书当前只支持 |
1
|
返回:
| 类型 | 描述 |
|---|---|
NestedDict
|
飞书返回的 |
引发:
| 类型 | 描述 |
|---|---|
FeishuError
|
请求失败或返回错误码时抛出。 |
飞书文档
示例:
源代码位于: feishu/mail/events.py
unsubscribe
async
¶
Python
unsubscribe(user_mailbox_id: str, *, event_type: int = 1) -> NestedDict
取消订阅指定用户邮箱的邮件相关事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
|
str
|
用户邮箱地址,或用户态调用时的 |
必需 |
|
int
|
事件类型,飞书当前只支持 |
1
|
返回:
| 类型 | 描述 |
|---|---|
NestedDict
|
飞书返回的 |
引发:
| 类型 | 描述 |
|---|---|
FeishuError
|
请求失败或返回错误码时抛出。 |
飞书文档
示例: