主题
根据岗位查询用户 3.4.1.Beta2+
接口说明
请求URL:http[s]://{网关地址}/position/getUserByPosition
请求方式: POST
请求内容类型: application/json
响应内容类型: application/json
请求说明
请求体
| 字段名 | 参数名 | 必填 | 类型 | 描述 |
|---|---|---|---|---|
| 岗位ID | positionId | M | String | 岗位ID |
| 校内机构代码 | deptCode | O | String | 校内机构代码 |
请求示例
json
{
"positionId":"956577714473381888"
}1
2
3
2
3
响应说明
响应体
数据格式:
JSON
| 字段名 | 参数名 | 类型 | 描述 |
|---|---|---|---|
| 返回码 | errcode | String | 0 成功,其他为不成功 |
| 返回码描述 | errmsg | String | 返回码描述 |
| 返回对象 | data | PositionUser | 返回的用户信息 |
| 字段名 | 参数名 | 类型 | 描述 |
|---|---|---|---|
| 用户列表 | userList | List<User> | 用户列表 |
| 字段名 | 参数名 | 类型 | 描述 |
|---|---|---|---|
| 用户名/学工号 | userId | String | 用户名/学工号 |
| 用户姓名 | userName | String | 用户姓名 |
| 校内机构代码 | deptCode | String | 校内机构代码 |
| 校内机构名称 | deptName | String | 校内机构名称 |
| 排序号 | sortNum | Integer | 当入参deptCode有值时返回排序号 |
响应示例
json
{
"errcode": "0",
"errmsg": "success",
"data": {
"userList": [
{
"userId": "1888001",
"userName": "yujiaxin1",
"deptCode": "12",
"deptName": "12",
"sortNum": 0
},
{
"userId": "zxm019",
"userName": "zxm019",
"deptCode": "12",
"deptName": "12",
"sortNum": 1
},
{
"userId": "222222",
"userName": "易表通测试账号",
"deptCode": "123",
"deptName": "奥德赛大2312",
"sortNum": 2
},
{
"userId": "zxm018",
"userName": "zxm018",
"deptCode": "12",
"deptName": "12",
"sortNum": 3
}
]
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
错误码
| 错误码 | 描述 |
|---|---|
| 111001 | 必填参数不能为空 |
| 117004 | 岗位ID不存在 |
| 999 | 统一错误码,详细描述信息参见接口返回 |
Demo
java
// 创建客户端
Client client = new DefaultClient(BASE_URL, APP_ID, APP_SECRET);
// 创建请求对象
GetUserByPositionRequest request = new GetUserByPositionRequest();
request.setPositionId("1186300612942622720");
BaseResponse response = client.execute(request);
//调用成功,则处理业务逻辑
if (response.isSuccess()) {
//.....
}1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11

