app_access_token
feishu.auth.app_access_token
¶
get_app_access_token
¶
Python
get_app_access_token(app_id: str, app_secret: str, app_ticket: str, timeout: int = 120) -> FlatDict
Python
get_app_access_token(app_id: str, app_secret: str, app_ticket: str | None = None, timeout: int = 120) -> FlatDict
获取应用访问凭证
这是一个通用函数,根据传入的参数自动判断是自建应用还是商店应用,并调用相应的函数。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
应用唯一标识(以 |
required |
|
str
|
应用秘钥 |
required |
|
str | None
|
平台定时推送给应用的临时凭证 |
None
|
|
int
|
超时时间。默认为 120 秒。 |
120
|
Returns:
Type | Description |
---|---|
FlatDict
|
应用访问凭证 |
飞书文档
功能 | 实现函数 |
---|---|
获取自建应用的应用访问凭证 | feishu.auth.app_access_token.get_app_access_token_internal |
获取商店应用的应用访问凭证 | feishu.auth.app_access_token.get_app_access_token_store |
Examples:
Source code in feishu/auth/app_access_token.py
get_app_access_token_internal
¶
自建应用获取应用访问凭证
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
应用唯一标识(以 |
required |
|
str
|
应用秘钥 |
required |
|
int
|
超时时间。默认为 120 秒。 |
120
|
Returns:
Type | Description |
---|---|
FlatDict
|
应用访问凭证 |
Examples:
Python Console Session | |
---|---|
Source code in feishu/auth/app_access_token.py
get_app_access_token_store
¶
Python
get_app_access_token_store(app_id: str, app_secret: str, app_ticket: str, timeout: int = 120) -> FlatDict
商店应用获取应用访问凭证
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
应用唯一标识(以 |
required |
|
str
|
应用秘钥 |
required |
|
str
|
平台定时推送给应用的临时凭证 |
required |
|
int
|
超时时间。默认为 120 秒。 |
120
|
Returns:
Type | Description |
---|---|
FlatDict
|
应用访问凭证 |
Examples:
Python Console Session | |
---|---|