attendees
feishu.calendar.attendees
¶
AttendeesNamespace
¶
Bases: Namespace
日程参与人接口命名空间。
通过 client.calendar.attendees 访问,封装飞书日历中日程参与人(attendee)相关的服务端接口,
包括参与人的添加、列举与删除等能力。参与人隶属于某个日程,以 attendee_id 标识。
通常无需直接实例化,应通过 client.calendar.attendees 访问。
飞书文档
源代码位于: feishu/calendar/attendees.py
| Python | |
|---|---|
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
add
async
¶
add(calendar_id: str, event_id: str, attendees: list[dict[str, Any]], *, need_notification: bool | None = None) -> NestedDict
添加日程参与人。
attendees 是待添加的参与人列表,作为请求体的 attendees 字段发送,每个元素
常见键包括 type、user_id、chat_id、room_id、third_party_email 等。
仅当显式传入 need_notification 时才将其并入请求体的 need_notification 字段。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
|
str
|
日历的 |
必需 |
|
str
|
日程的 |
必需 |
|
list[dict[str, Any]]
|
待添加的参与人列表,例如 |
必需 |
|
bool | None
|
是否在添加后发送 Bot 通知;为空时省略该字段。 |
None
|
返回:
| 类型 | 描述 |
|---|---|
NestedDict
|
包含 |
NestedDict
|
|
引发:
| 类型 | 描述 |
|---|---|
FeishuError
|
请求失败或返回错误码时抛出。 |
飞书文档
示例:
| Python Console Session | |
|---|---|
源代码位于: feishu/calendar/attendees.py
delete
async
¶
delete(calendar_id: str, event_id: str, attendee_ids: list[str]) -> NestedDict
删除日程参与人。
attendee_ids 为待删除参与人的 ID 列表,原样作为请求体的 attendee_ids 字段发送。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
|
str
|
日历的 |
必需 |
|
str
|
日程的 |
必需 |
|
list[str]
|
待删除参与人的 |
必需 |
返回:
| 类型 | 描述 |
|---|---|
NestedDict
|
接口返回的数据(通常为空)。 |
引发:
| 类型 | 描述 |
|---|---|
FeishuError
|
请求失败或返回错误码时抛出。 |
飞书文档
示例:
| Python Console Session | |
|---|---|
源代码位于: feishu/calendar/attendees.py
list
async
¶
list(calendar_id: str, event_id: str, *, page_size: int = 50, max_items: int | None = None) -> list[NestedDict]
获取日程参与人列表。
自动翻页并将各页结果拼接为单个列表返回。page_size 会被限制在
[feishu.consts.MAX_PAGE_SIZE][] 以内。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
|
str
|
日历的 |
必需 |
|
str
|
日程的 |
必需 |
|
int
|
每页条数,默认为 50,超过上限时按上限截断。 |
50
|
|
int | None
|
最多返回的条数;为空表示返回全部。 |
None
|
返回:
| 类型 | 描述 |
|---|---|
list[NestedDict]
|
参与人数据列表,每项包含 |
引发:
| 类型 | 描述 |
|---|---|
FeishuError
|
请求失败或返回错误码时抛出。 |
飞书文档
示例:
| Python Console Session | |
|---|---|