列出标签
列出邮件标签,包括ID、名称、颜色、未读信息等内容
请求
| 项目 | 值 |
|---|---|
| HTTP URL | https://open.feishu.cn/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels |
| HTTP Method | GET |
| 接口频率限制 | 10 次/秒 |
| 支持的应用类型 | custom |
| 权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 开启任一权限即可 | mail:user_mailbox.message:modify 修改邮件 mail:user_mailbox.message:readonly 查询用户邮件 |
请求头
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | string | 是 | tenant_access_token 或 user_access_token 值格式:"Bearer access_token" 示例值:"Bearer u-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token |
路径参数
| 名称 | 类型 | 描述 |
|---|---|---|
user_mailbox_id | string | 用户邮箱地址。当使用用户身份访问时,可以输入"me"代表当前调用接口用户 示例值:"user@xxx.xx 或 me" |
响应
响应体
| 名称 | 类型 | 描述 |
|---|---|---|
code | int | 错误码,非 0 表示失败 |
msg | string | 错误描述 |
data | \- | - |
└ items | label\[\] | 标签列表 |
└ id | string | 标签ID |
└ name | string | 标签名称,最长 255 个字符。支持嵌套标签,嵌套层级之间以 / 分隔(如 a/b/c 表示三级嵌套标签)。创建或更新嵌套标签时,需要传入完整路径(如 a/b/c),不能只传最后一级名称。 |
└ background_color | string | 标签背景颜色,支持以下颜色值:blue、indigo、purple、violet、carmine、red、orange、yellow、lime、green、turquoise、wathet |
└ messages_unread | int | 带有该标签的未读邮件数量 |
响应体示例
json
{
"code": 0,
"msg": "success",
"data": {
"items": [
{
"id": "7620003644728938013",
"name": "test",
"background_color": "blue",
"messages_unread": 0
}
]
}
}错误码
| HTTP状态码 | 错误码 | 描述 | 排查建议 |
|---|---|---|---|
| 400 | 1234000 | invalid params | 不合法的参数,请参考本文档修改参数 |
| 500 | 1234017 | internal error | 服务器内部错误,请重试 |
| 403 | 1234030 | permission deny | 无权限访问,请检查权限申请状态 |
| 400 | 1234013 | user mailbox not found or user mailbox not active | 指定邮箱地址不存在,或邮箱地址状态不正确,请检查输入的邮箱地址是否正确 |
