创建公共邮箱
创建一个公共邮箱。
请求
| 项目 | 值 |
|---|---|
| HTTP URL | https://open.feishu.cn/open-apis/mail/v1/public_mailboxes |
| HTTP Method | POST |
| 接口频率限制 | 50 次/秒 |
| 支持的应用类型 | custom |
| 权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 | mail:public_mailbox 查询、创建、修改公共邮箱 |
| 字段权限要求 | > Tip: 该接口返回体中存在下列敏感字段,仅当开启对应的权限后才会返回;如果无需获取这些字段,则不建议申请 mail:public_mailbox.public_mailbox_geo 查看公共邮箱数据驻留地 |
请求头
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | string | 是 | tenant_access_token 值格式:"Bearer access_token" 示例值:"Bearer t-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token |
| Content-Type | string | 是 | 固定值:"application/json; charset=utf-8" |
请求体
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
email | string | 否 | 公共邮箱地址 示例值:"test_public_mailbox@xxx.xx" |
name | string | 否 | 公共邮箱名称 示例值:"test public mailbox" |
geo | string | 否 | 数据驻留地 示例值:"cn" |
请求体示例
json
{
"email": "test_public_mailbox@xxx.xx",
"name": "test public mailbox",
"geo": "cn"
}响应
响应体
| 名称 | 类型 | 描述 |
|---|---|---|
code | int | 错误码,非 0 表示失败 |
msg | string | 错误描述 |
data | public_mailbox | - |
└ public_mailbox_id | string | 公共邮箱唯一标识 |
└ email | string | 公共邮箱地址 |
└ name | string | 公共邮箱名称 |
└ geo | string | 数据驻留地 字段权限要求: mail:public_mailbox.public_mailbox_geo 查看公共邮箱数据驻留地 |
响应体示例
json
{
"code": 0,
"msg": "success",
"data": {
"public_mailbox_id": "xxxxxxxxxxxxxxx",
"email": "test_public_mailbox@xxx.xx",
"name": "test public mailbox",
"geo": "cn"
}
}错误码
| HTTP状态码 | 错误码 | 描述 | 排查建议 |
|---|---|---|---|
| 409 | 1234006 | email address has been used | 邮件地址已被占用,请使用其他邮件地址 |
| 400 | 1234008 | email or name is invalid | 邮件地址或名称不合法,请修改后重试 |
| 409 | 1234033 | email address has been used by another member as login account | 邮件地址已被他人用作登录邮箱,请使用其他邮件地址 |
| 200 | 1234026 | The number of tenant public mailboxes has reached the limit and cannot be created | 公共邮箱创建数已达上限,请删除后重试 |
| 400 | 1234040 | not set geo name auth | 没有设置geo的权限 |
| 400 | 1234041 | tenant not open mg not set geo name | 租户没有开通MG,不能设置geo字段 |
| 400 | 1234042 | req set geo not find in geo list | 您设置的 geo 不在系统支持的 geo 列表中 |
