loading-img
考生查询接口

1、爱科举开放接口使用JWT规范(Json web token);

2、获取AppID和AppKey,商业版用户登录管理端,进入【系统管理】-【开发平台】获取AppID和AppKey;

3、以Java开发为例,安装maven依赖:

<!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt -->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>


3、接口地址https://admin.ikeju.net/api/{AppID}


4、生成jwt数据:

String app_key = "SV0opAea621484K3fcLRGfM05W2";
Map map = new HashMap();
map.put("action", "userList");
Date now = new Date(System.currentTimeMillis());
String jwt = "";
try {
   jwt ="ikeju_"+ Jwts.builder().setClaims(map).setExpiration(new Date(now.getTime() + 1000 * 10 * 60)).signWith(SignatureAlgorithm.HS512, app_key.getBytes("UTF-8")).compact();
} catch (UnsupportedEncodingException e) {
   e.printStackTrace();
}

代码说明:

(1)必须使用ikeju作为前缀;

(2)一定要使用getBytes("UTF-8");

(3)map.put("action", "userList") 为固定格式,action为userList表示执行的是查询考生列表;


5、封装数据,发送请求到接口https://admin.ikeju.net/api/{AppID}

参数编号参数名称是否必填参数示例参数说明
1page1查询页码


6、返回数据

{"rows":[   {"depart":null,"email":null,"faceURL":null,"idCard":null,"mobile":null,"trueName":"gggsgsdgs","userName":"2fOGa"},   {"depart":null,"email":null,"faceURL":null,"idCard":null,"mobile":null,"trueName":"testtttte","userName":"2DsCR"},   {"depart":null,"email":null,"faceURL":null,"idCard":null,"mobile":null,"trueName":"11","userName":"2VTMx"},   {"depart":null,"email":null,"faceURL":null,"idCard":null,"mobile":"17699090909","trueName":"东哥","userName":"2Kkve"},   {"depart":null,"email":null,"faceURL":null,"idCard":null,"mobile":"17610821987","trueName":"111","userName":"2Zzss"},   {"depart":"销售运营部","email":null,"faceURL":null,"idCard":null,"mobile":"17702425893","trueName":"韩先生","userName":"17702425893"},   {"depart":"财务法务部","email":null,"faceURL":null,"idCard":null,"mobile":"17702427893","trueName":"刘羽","userName":"15210918894"},   {"depart":"运营一部","email":null,"faceURL":null,"idCard":null,"mobile":"15210918895","trueName":"刘羽","userName":"15210918895"},   {"depart":"政府项目部下级下级","email":"","faceURL":"","idCard":null,"mobile":"13509889999","trueName":"2222","userName":"test1222"},   {"depart":"政府项目部下级","email":"","faceURL":"","idCard":null,"mobile":"15804960783","trueName":"小爱","userName":"15804960783"}],   "total":32}

 rows表示该页码对应的考生json信息,total表示考生总数

参数编号参数名称参数说明
1userId用户id,系统唯一
2userName账户名称,系统唯一
3trueName真实姓名
4mobile手机号码,系统唯一
5idCard身份证号
6faceURL头像地址
7emailEmail
8depart所在部门