跳转至

员工批量查询(分页)

功能说明

员工批量查询(分页)

接口地址

HTTP请求方式

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

参数说明

  • 公有参数

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

  • 私有参数

参数名称 是否必须 参数类型 长度限制 描述
enterprise_code string [1,20] 企业编号(集团和运营商必填,企业不填)
page_index int 页码(默认为1)
page_size int 每页记录数,默认为10,建议最多为50

请求示例(HTTP)

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

access_token=5ac48105ec3f86be2eaf8aa14747ce7c&page_index=1&page_size=10&
timestamp=1491807767&sign=59347a7a511ff0a4150aaf7c86ec15cb91a7bcb5

请求示例(JAVA SDK)

public class Main {
    public static OpenClient openClient = new OpenClient(Constants.BASE_URL_TEST, "xxx", "xxx");
    public static void main(String[] args) {
        EmployeeBatchGetRequest employeeBatchGetRequest = new EmployeeBatchGetRequest();
        Pagination<EmployeeBatchGetResp> employeeBatchGetRespPagination = openClient.employeeApi().batchGetEmployee(employeeBatchGetRequest);
        System.out.println(JSON.toJSONString(employeeBatchGetRespPagination));
    }
}

返回参数说明

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

正确返回示例

{
  "code": 0,
  "data": {
    "dataList": [
      {
        "birth_day": null,
        "card_no": "",
        "card_type": 0,
        "corp_code": "CJJ101",
        "level": "123",
        "dept_code": "A100",
        "email": "zhangsan@guanaitong.com",
        "entry_day": null,
        "gender": 2,
        "mobile_area":86,
        "mobile": "14444444444",
        "name": "张三",
        "remark": "",
        "time_active": "2022-01-01",
        "time_created": "2021-12-12"
      },
      {
        "birth_day": null,
        "card_no": "",
        "card_type": 0,
        "level": "123",
        "dept_code": "A100",
        "corp_code": "HB008",
        "email": "",
        "entry_day": null,
        "gender": 3,
        "mobile_area":86,
        "mobile": "13400000008",
        "name": "李四",
        "remark": "",
        "time_active": null,
        "time_created": "2021-10-11"
      }
    ],
    "hasNext": false,
    "totalCount": 10
  },
  "msg": "OK"
}

错误返回示例

{
    "code": 1000240002,
    "data": null,
    "msg": "enterprise_code校验失败"
}

常见错误码

错误码 错误信息 排查方法
1000240002 enterprise_code校验失败 检查enterprise_code是否是已绑定的编码
other 其他公共错误码 [其他公共错误码](
回到页面顶部