# 查询邮箱是否存在

用于获取邮箱在租户下是否存在

# 请求

基本
HTTP URL https://hi-gw.weizhipin.com/open-apis/mail/v1/users/query
HTTP Method POST
支持的应用类型 自建应用
权限要求 [邮箱]-[查询邮箱通用信息]

# 请求头

名称 类型 必填 描述
Authorization string tenant_access_token
值格式:"Bearer access_token"
示例值:"Bearer t-7f1bcd13fc57d46bac21793a18e560"
Content-Type string 固定值:"application/json; charset=utf-8"

# 查询参数(url后?&拼接的参数)

名称 类型 描述
user_id_type string 用户 ID 类型示例值:"open_id"
可选值有:
open_id:用户的 open id
union_id:用户的 union id
user_id:用户的 user id
默认值:open_id

# 请求体

名称 类型 必填 描述
mailbox_addresses string数组 示例值[zenglinhong@kanzhun.com,wendangji@kanzhun.com]
需要带上邮箱后缀,可传入多个邮箱地址,若不存在的将不会在返回体的数组中体现

# 请求体示例

{
  "mailbox_addresses": [
    "zenglinhong@kanzhun.com",
    "ssssdad@22.com"
  ]
}
1
2
3
4
5
6

# 响应

# 响应体

名称 类型 描述
code int 错误码,非 0 表示失败
msg string 调用描述
trace_id string 链路id
data - -
  ∟ items list 数据数组
  ∟∟ mailbox_name string 邮箱名称
  ∟∟ disabled boolean 是否禁用
  ∟∟ mailbox_address string 邮箱地址
  ∟∟ mailbox_type int 邮箱类型
1、个人邮箱
2、邮件组
3、公共邮箱
  ∟∟ user_id string 个人邮箱时有值
  ∟∟ public_email_type int 0、项目
1、系统
(个人邮箱和邮件组该项无值)

# 响应体示例

{
  "code": 0,
  "success": true,
  "data": {
    "items": [
      {
        "mailboxAddress": "zenglinhong@kanzhun.com",
        "mailboxName": "zenglinhong",
        "mailboxType": 1,
        "disabled": false,
        "userId": "ou_0f3515e29cf40617de3f2"
      }
    ]
  },
  "msg": "操作成功",
  "traceId": "_Ap-fzCJSJ2o7wAB"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

如果响应非成功状态,请对照 错误码文档

最后更新于 : 8/21/2023, 4:57:10 PM