1. 查询雇员信息

2. 查询机构雇员

3. 查询多机构雇员

雇员

1. 查询雇员信息

GET

/v1/organizations/{code}/employees/{employee}?access_token={access_token}&type={type}

请求头

请求头 说明
Content-Type application/json

请求参数

字段 类型 是否必填 说明
access_token String Y 访问令牌
code String Y 组织标识
employee String Y 雇员标识
type String N 为user时,employee为用户标识,其余情况为雇员ID标识

请求示例

/v1/organizations/85939199-6424-4f28-84d4-fce2aedf0e64/employees/374?access_token=b646339e2f4f4234af6bae5f72db9879

返回数据

application/json
字段 类型 说明
domain_id String 域标识
user_id String 用户标识
name String 用户名
username String 用户账号
gender String 性别
data_schemas/name String 默认属性名称
data_schemas/alias String 显示属性名称
{
    "status": 0, 
    "message": "Everything is ok.", 
    "result": {
        "domain_id": "atwork", 
        "org_code": "85939199-6424-4f28-84d4-fce2aedf0e64", 
        "display_name": "测试张三", 
        "employee_type_id": 125, 
        "employee_type": "正式员工", 
        "id": 374, 
        "name": "测试张三", 
        "type": "EMPLOYEE", 
        "sort_order": 999, 
        "user_id": "a86e83a26be44eb59806901cc8be5d5c", 
        "username": "13533545408", 
        "nickname": "测试张三", 
        "status": "ACTIVATED", 
        "senior": true, 
        "sn": "200813524967", 
        "gender": "UNKNOWN", 
        "pinyin": "ceshizhangsan", 
        "initial": "cszs", 
        "avatar": "Z3JvdXAxL00wMC8wMC81Ri9yQkFCR1ZlX216V0FUOV9DQUFFMEFPMjZZOFE5NTEuanBn", 
        "more_info": { }, 
        "settings": { }, 
        "mobile": "13533545408", 
        "email": "123@11.com", 
        "created": 0, 
        "last_modified": 0, 
        "expired": 0, 
        "disabled": false, 
        "root_org_info": {
            "id": 144, 
            "name": "我的组织3"
        }, 
        "positions": [
            {
                "employee_id": 374, 
                "org_id": 144, 
                "org_name": "研发部", 
                "job_title": "初级", 
                "path": "/144/", 
                "type": "ORG", 
                "primary": true, 
                "chief": false
            }
        ], 
        "properties": [ ], 
        "data_schemas": [
            {
                "id": 1954, 
                "type": "TEXT", 
                "domain_id": "atwork", 
                "org_code": "85939199-6424-4f28-84d4-fce2aedf0e64", 
                "name": "姓名", 
                "alias": "姓名", 
                "property": "name", 
                "options": [ ], 
                "min": -1, 
                "max": -1, 
                "sort_order": 4, 
                "opsable": false
            }, 
            {
                "id": 1955, 
                "type": "TEXT", 
                "domain_id": "atwork", 
                "org_code": "85939199-6424-4f28-84d4-fce2aedf0e64", 
                "name": "职位", 
                "alias": "职位", 
                "property": "positions", 
                "options": [ ], 
                "min": -1, 
                "max": -1, 
                "sort_order": 5, 
                "opsable": false
            }, 
            {
                "id": 1957, 
                "type": "MOBILE_PHONE", 
                "domain_id": "atwork", 
                "org_code": "85939199-6424-4f28-84d4-fce2aedf0e64", 
                "name": "手机", 
                "alias": "手机", 
                "property": "mobile", 
                "options": [ ], 
                "min": -1, 
                "max": -1, 
                "sort_order": 9, 
                "opsable": true
            }, 
            {
                "id": 1958, 
                "type": "EMAIL", 
                "domain_id": "atwork", 
                "org_code": "85939199-6424-4f28-84d4-fce2aedf0e64", 
                "name": "邮箱", 
                "alias": "邮箱", 
                "property": "email", 
                "options": [ ], 
                "min": -1, 
                "max": -1, 
                "sort_order": 10, 
                "opsable": true
            }, 
            {
                "id": 1959, 
                "type": "TEXT", 
                "domain_id": "atwork", 
                "org_code": "85939199-6424-4f28-84d4-fce2aedf0e64", 
                "name": "工号", 
                "alias": "工号", 
                "property": "sn", 
                "options": [ ], 
                "min": -1, 
                "max": -1, 
                "sort_order": 11, 
                "opsable": true
            }
        ]
    }
}

错误返回值

status message 说明
10011 token not found. 访问令牌不存在

2. 查询机构雇员

GET

/v1/organizations/{code}/employees?access_token={access_token}

请求头

请求头 说明
Content-Type application/json

请求参数

字段 类型 是否必填 说明
access_token String Y 访问令牌
code String Y 组织标识
type String N 默认值为"id",为"username"时,query为用户名查询
org_id String N 组织ID,该字段非空时,查该组织下的雇员
query String N 查询条件,org_id为空时,改字段不为空
path String N 组织路径,org_id为空,该字段非空时,查该路径下,符合query查询条件的雇员
matching boolean N 是否匹配查询,当org_id和path为空时,为true时,按type和query条件搜索,为false时,模糊查询
recursion String N 是否递归,为"true"时包含子组织信息
page int N 页码数
limit int N 分页大小

请求示例

[1].根据组织ID获取组织信息,备注:[org_id为组织ID,必填],[filter为是否过滤视图,必填]
/v1/organizations/85939199-6424-4f28-84d4-fce2aedf0e64/employees?access_token=6a4ece19c50c4fd28cd3c67256fab37a&org_id=144&filter=false
[2].根据组织path和雇员名获取雇员信息,备注:[path为组织全路径],[query传入雇员名],是完全匹配
/v1/organizations/85939199-6424-4f28-84d4-fce2aedf0e64/employees?access_token=6a4ece19c50c4fd28cd3c67256fab37a&path=/144/3465/&query=forest
[3].批量获取雇员信息,备注:type=username或type=id,matching=true为固定值
/v1/organizations/85939199-6424-4f28-84d4-fce2aedf0e64/employees?access_token=6a4ece19c50c4fd28cd3c67256fab37a&matching=true&type=username&query=Forest003,Forest001
[4].模糊查询雇员信息,备注:
/v1/organizations/85939199-6424-4f28-84d4-fce2aedf0e64/employees?access_token=6a4ece19c50c4fd28cd3c67256fab37a&query=1

返回数据

application/json
字段 类型 说明
domain_id String 域标识
user_id String 用户标识
name String 用户名
username String 用户账号
gender String 性别
{
    "status": 0, 
    "message": "Everything is ok.", 
    "result": [
        {
            "domain_id": "atwork", 
            "org_code": "85939199-6424-4f28-84d4-fce2aedf0e64", 
            "display_name": "测试张三", 
            "employee_type_id": 125, 
            "employee_type": "正式员工", 
            "id": 374, 
            "name": "测试张三", 
            "type": "EMPLOYEE", 
            "sort_order": 999, 
            "user_id": "a86e83a26be44eb59806901cc8be5d5c", 
            "username": "13533545408", 
            "nickname": "测试张三", 
            "status": "ACTIVATED", 
            "senior": true, 
            "sn": "200813524967", 
            "gender": "UNKNOWN", 
            "pinyin": "ceshizhangsan", 
            "initial": "cszs", 
            "avatar": "Z3JvdXAxL00wMC8wMC81Ri9yQkFCR1ZlX216V0FUOV9DQUFFMEFPMjZZOFE5NTEuanBn", 
            "more_info": { }, 
            "settings": { }, 
            "mobile": "13533545408", 
            "email": "123@11.com", 
            "created": 0, 
            "last_modified": 0, 
            "expired": 0, 
            "disabled": false, 
            "root_org_info": {
                "id": 144, 
                "name": "我的组织3"
            }, 
            "positions": [
                {
                    "employee_id": 374, 
                    "org_id": 144, 
                    "org_name": "研发部", 
                    "job_title": "初级", 
                    "path": "/144/", 
                    "type": "ORG", 
                    "primary": true, 
                    "chief": false
                }
            ]
        }
    ]
}

错误返回值

status message 说明
10011 token not found. 访问令牌不存在

3. 查询多机构雇员

POST

/v1/organizations/employees?access_token={access_token}

请求头

请求头 说明
Content-Type application/json

请求参数

字段 类型 是否必填 说明
access_token String Y 访问令牌
org_codes String Y 组织orgCode集合
query String N 模糊查询条件

请求示例

/v1/organizations/employees?access_token=b646339e2f4f4234af6bae5f72db9879
{
    "org_codes": [
        "85939199-6424-4f28-84d4-fce2aedf0e64"
    ], 
    "query": "李"
}

返回数据

application/json
{
    "status": 0, 
    "message": "Everything is ok.", 
    "result": [ ]
}

错误返回值

status message 说明
10011 token not found. 访问令牌不存在
202012 没有对应的雇员. 没有对应的雇员

results matching ""

    No results matching ""