创建邮件组
创建一个邮件组
请求
| 项目 | 值 |
|---|---|
| HTTP URL | https://open.feishu.cn/open-apis/mail/v1/mailgroups |
| HTTP Method | POST |
| 接口频率限制 | 100 次/秒 |
| 支持的应用类型 | custom |
| 权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 | mail:mailgroup 查询、创建、修改、删除邮件组 |
请求头
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | string | 是 | tenant_access_token 值格式:"Bearer access_token" 示例值:"Bearer t-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token |
| Content-Type | string | 是 | 固定值:"application/json; charset=utf-8" |
请求体
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
email | string | 否 | 邮件组地址 示例值:"test_mail_group@xxx.xx" |
name | string | 否 | 邮件组名称 示例值:"test mail group" |
description | string | 否 | 邮件组描述 示例值:"mail group for testing" |
who_can_send_mail | string | 否 | 谁可发送邮件到此邮件组 示例值:"ALL_INTERNAL_USERS" 可选值有: - ANYONE: 任何人 - ALL_INTERNAL_USERS: 仅组织内部成员 - ALL_GROUP_MEMBERS: 仅邮件组成员 - CUSTOM_MEMBERS: 自定义成员 |
请求体示例
json
{
"email": "test_mail_group@xxx.xx",
"name": "test mail group",
"description": "mail group for testing",
"who_can_send_mail": "ALL_INTERNAL_USERS"
}响应
响应体
| 名称 | 类型 | 描述 |
|---|---|---|
code | int | 错误码,非 0 表示失败 |
msg | string | 错误描述 |
data | mailgroup | - |
└ mailgroup_id | string | 邮件组ID |
└ email | string | 邮件组地址 |
└ name | string | 邮件组名称 |
└ description | string | 邮件组描述 |
└ direct_members_count | string | 邮件组成员数量 |
└ include_external_member | boolean | 是否包含外部成员 |
└ include_all_company_member | boolean | 是否是全员邮件组 |
└ who_can_send_mail | string | 谁可发送邮件到此邮件组 可选值有: - ANYONE: 任何人 - ALL_INTERNAL_USERS: 仅组织内部成员 - ALL_GROUP_MEMBERS: 仅邮件组成员 - CUSTOM_MEMBERS: 自定义成员 |
响应体示例
json
{
"code": 0,
"msg": "success",
"data": {
"mailgroup_id": "xxxxxxxxxxxxxxx",
"email": "test_mail_group@xxx.xx",
"name": "test mail group",
"description": "mail group for testing",
"direct_members_count": "10",
"include_external_member": true,
"include_all_company_member": false,
"who_can_send_mail": "ALL_INTERNAL_USERS"
}
}错误码
| HTTP状态码 | 错误码 | 描述 | 排查建议 |
|---|---|---|---|
| 400 | 1234019 | mail address's domain not found | 请确认域名是否存在 |
| 409 | 1234006 | email address has been used | 邮件地址已被占用,请使用其它邮件地址 |
| 400 | 1234008 | request parameter error | 请检查请求参数是否正确 |
| 400 | 1234030 | mailing group count is over max limit | 邮件组数量已达上限 |
| 409 | 1234033 | email address has been used by another member as login account | 邮件地址已被他人用作于登录邮箱,请使用其它邮件地址 |
