跳转至

员工查询

功能说明

根据工号、手机号或者邮箱等查询企业平台下的在职员工信息

接口地址

HTTP请求方式

  • Method: POST
  • Content-Type: application/x-www-form-urlencoded

参数说明

  • 公有参数

    发送请求是必须传入公共参数,详见公共参数

  • 私有参数

参数名称 是否必须 参数类型 长度限制 描述
userid string [1,100] 员工第三方唯一标识,不会变更
enterprise_code string [1,20] 企业编号(集团和运营商必填,企业不填)
mobile_area int [1,10] 手机号区号
mobile string [6,20] 员工绑定手机号
email string [1,100] 员工绑定邮箱

请求示例(HTTP)

POST /employee/get HTTP/1.1
Host: openapi.guanaitong.tech
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

access_token=a9574640d1030306d684706ecbf5d84f&corp_code=LOL001&
timestamp=1492671874&sign=b314c43d96345a364c65c982ef1c95ab55fa3482

请求示例(JAVA SDK)

public class Main {
    public static OpenClient openClient = new OpenClient(Constants.BASE_URL_TEST, "xxx", "xxx");
    public static void main(String[] args) {
        EmployeeGetRequest employeeGetRequest = new EmployeeGetRequest();
        employeeGetRequest.setMobile("14253142358");
        EmployeeGetResp employeeGetResp = openClient.employeeApi().get(employeeGetRequest);
        System.out.println(employeeGetResp);
    }
}

返回参数说明

参数名称 描述
code 返回码。详见错误返回码
msg 如果错误,返回错误信息。
data 如果没有错误,返回业务数据
data.userid 员工第三方唯一标识
data.corp_code 员工工号
data.name 员工姓名
data.gender 员工性别
data.card_type 证件类型
data.card_no 证件号码
data.email 邮箱
data.mobile_area 手机区号
data.mobile 手机号
data.remark 备注
data.dept_code 部门编号
data.dept_name 部门名称
data.level 员工分级(需先在企业后台开启该功能,否则返回null)
data.category 员工分类(需先在企业后台开启该功能,否则返回null)
data.birth_day 生日,格式为yyyy-MM-dd
data.entry_day 入职日期,格式为yyyy-MM-dd
data.time_created 注册日期
data.time_active 激活日期(首次登陆日期)

正确返回示例

{
    "code":0,
    "data":{
        "corp_code":"TOM082401",
        "name":"tom082401",
        "gender":1,
        "card_type":1,
        "card_no":"110101199003070919",
        "email":"168989890901@tom.com",
        "mobile":"16898989110",
        "dept_code":"TOM071201",
        "dept_name":"TOM071201",
        "level":"金丹",
        "category":[
            "帅哥组"
        ],
        "remark":"test",
        "birth_day":"1990-07-05",
        "entry_day":"2022-06-29",
        "time_created":"2022-08-24",
        "userid":"tom082401"
    },
    "msg":"OK"
}

错误返回示例

{
    "code": 1000210004,
    "data": null,
    "msg": "tokeninfo check failed!"
}

常见错误码

错误码 错误信息 排查方法
1000220002 userid、mobile和email最少填一项 检测参数是否按要求填写
1000220096 该用户ID对应员工不存在 userid对应员工是否已添加
1000220102 员工不存在 userid对应员工是否已添加
1000240002 enterprise_code校验失败 检查enterprise_code是否是已绑定的编码
other 其他公共错误码 其他公共错误码
回到页面顶部