员工身份(EIAM)
 获取用户的岗位
   接口
 # 权限
身份管理API是以应用维度授权的,在调用接口前需为不同的应用设置接口权限,详情请参考API权限。
| 权限代码 | 描述 | 
|---|---|
| user_all | 用户管理接口的读写权限 | 
| user_read | 用户管理接口的读权限 | 
| all | 全部接口读写权限 | 
| read | 所有读接口的权限 | 
# 请求说明
GET https://{your_domain}/api/v2/tenant/users/{user_id}/jobs?relation_type=
# 请求头
| 参数名 | 中文名称 | 必须 | 类型 | 描述 | 
|---|---|---|---|---|
| Authorization | 授权 | 是 | String | 格式:Bearer {access_token} | 
| Content-Type | 内容类型 | 是 | String | 固定值:application/json; charset=utf-8 | 
# 请求示例
无
# 请求参数
| 参数名 | 中文名称 | 必须 | 类型 | 描述 | 
|---|---|---|---|---|
| user_id | 用户ID | 是 | String | |
| relation_type | 岗位类型 | 是 | String | 为空时查询所有类型。1为主要岗位,0为兼职兼岗 | 
# 返回示例
正确示例:
HTTP/1.1 200 OK
Content-Type: application/json
{
    "total": 3,
    "jobs":  [
        {
            "job_id": "20240326154025150-9E79-C9D5D9022",
            "org_id": "20220825141325371-4D03-81EF80243",
            "position_id": "20210529172248496-D329-5748DE918",
            "title_id": "20230529172248496-D329-5748DE917",
            "relation_type": 1
        },
        {
            "job_id": "20240326154025150-9E79-C9D5D9033",
            "org_id": "20220825141325371-4D03-81EF80244",
            "position_id": "20210529172248496-D329-5748DE919",
            "title_id": "20230529172248496-D329-5748DE920",
            "relation_type": 0
        },
        {
            "job_id": "20240326154025150-9E79-C9D5D9044",
            "org_id": "20220825141325371-4D03-81EF80245",
            "position_id": "20210529172248496-D329-5748DE921",
            "title_id": "20230529172248496-D329-5748DE922",
            "relation_type": 0
        },
    ]
}
错误示例:
HTTP/1.1 400 Bad Request
{
  "error_msg": "用户不存在",
  "error_code": "USER.0001"
}
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
37
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
37
# 返回参数
| 参数名 | 中文名称 | 类型 | 描述 | 
|---|---|---|---|
| total | 总数 | int | |
| jobs | 用户岗位集合 | List | |
| --job_id | 岗位ID | String | |
| --org_id | 组织ID | String | |
| --position_id | 职位ID | String | |
| --title_id | 职务ID | String | |
| --relation_type | 岗位类型 | String | 1为主岗位 0为兼职兼岗 | 
# 错误码
| 状态码 | 错误码 | 错误信息 | 处理措施 | 
|---|---|---|---|
| 400 | ENT.CONFIG.0031 | 任职管理功能未开启,请先开启此功能 | 请先在企业中心开启任职管理 | 
| The job management function is not enabled, please enable this function first | |||
| 400 | OAP.PARAM.0004 | 参数[{0}]不符合校验规则 | 请检查入参是否符合校验规则 | 
| Parameter [{0}] does not comply with validation rules | |||
| 400 | USER.0001 | 用户不存在 | 请检查对应用户是否存在 | 
| User does not exist | 
