获取部门下员工数量¶
功能说明¶
获取部门下员工数量
接口地址¶
- 测试环境: https://openapi.guanaitong.tech/employee/getCountByDepartmentCode
- 生产环境: https://openapi.guanaitong.com/employee/getCountByDepartmentCode
HTTP请求方式¶
- Method: POST/GET
- Content-Type: application/x-www-form-urlencoded
参数说明¶
-
公有参数
发送请求是必须传入公共参数,详见公共参数
-
私有参数
| 参数名称 | 是否必须 | 参数类型 | 长度限制 | 描述 |
|---|---|---|---|---|
| dept_code | 是 | string | [1,50] | 部门编码 |
| enterprise_code | 否 | string | [1,20] | 企业编号(集团和运营商必填,企业不填) |
请求示例(HTTP)¶
https://openapi.guanaitong.tech/employee/getCountByDepartmentCode?
access_token=a9574640d1030306d684706ecbf5d84f&
dept_code=SZ001&sign=b314c43d96345a364c65c982ef1c95ab55fa3482&
timestamp=1492671874
请求示例(JAVA SDK)¶
public class Main {
public static OpenClient openClient = new OpenClient(Constants.BASE_URL_TEST, "xxx", "xxx");
public static void main(String[] args) {
EmployeeGetCountByDepartmentCodeRequest employeeGetCountByDepartmentCodeRequest = new EmployeeGetCountByDepartmentCodeRequest();
employeeGetCountByDepartmentCodeRequest.setDeptCode("TomCompany_第二个部门");
Integer countByDepartmentCode = openClient.employeeApi().getCountByDepartmentCode(employeeGetCountByDepartmentCodeRequest);
System.out.println(countByDepartmentCode);
}
}
返回参数说明¶
| 参数名称 | 描述 |
|---|---|
| code | 返回码。详见错误返回码。 |
| msg | 如果错误,返回错误信息。 |
| data | 返回部门下员工数量 |
正确返回示例¶
错误返回示例¶
常见错误码¶
| 错误码 | 错误信息 | 排查方法 |
|---|---|---|
| 1000220002 | 参数验证不通过 | 检测参数是否按要求填写 |
| 1000240002 | enterprise_code校验失败 | 检查enterprise_code是否是已绑定的编码 |
| 1000220010 | dept_code not exists ! | 部门编号不存在,校验是否对应部门已添加 |
| other | 其他公共错误码 | 其他公共错误码 |