1. 查询雇员信息

2. 删除雇员

3. 查询机构雇员

4. 雇佣雇员

5. 更新雇佣信息

6. 分页查询

雇员(admin)


1. 查询雇员信息

GET

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

请求头

请求头 说明
Content-Type application/json

请求参数

字段 类型 是否必填 说明
access_token String Y 访问令牌
code String Y 组织orgCode
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_schema_id": 1954, 
                "values": [
                    "我是自定义属性值"
                ]
            }
        ], 
        "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. 删除雇员

DELETE

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

请求头

请求头 说明
Content-Type application/json

请求参数

字段 类型 是否必填 说明
access_token String Y 访问令牌
code String Y 组织标识
employee Long Y 雇员标识

请求示例

/v1/admin/organizations/a918d8a6-67e9-4e76-8503-baa73d3c6fd2/employees/820?access_token=b646339e2f4f4234af6bae5f72db9879

返回数据

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

错误返回值

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

3. 查询机构雇员

GET

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

请求头

请求头 说明
Content-Type application/json

请求参数

字段 类型 是否必填 说明
access_token String Y 访问令牌
code String Y 组织标识
type String N 默认值为"id",为"username"时,query为用户名查询
query String Y 查询条件
path String N 组织路径,非空时,查该路径下,符合query查询条件的雇员
matching boolean N 为true时,根据type类型不同,按,隔开查雇员列表,为false时,模糊查询该机构下的雇员信息

请求示例

/v1/admin/organizations/10d71e67-3cdb-4866-b232-185e414de67c/employees?access_token=9611020d17034f73876bda13d26d315b&query=1234
[1].根据userid批量查询雇员信息
/v1/admin/organizations/{code}/employees?access_token={access_token}&matching=true&query=userId1,userId2,userId3
[2].根据username批量查询雇员信息
/v1/admin/organizations/{code}/employees?access_token={access_token}&matching=true&type=username&query=username1,username2,username3
[3].指定组织节点查询雇员信息
/v1/admin/organizations/{code}/employees?access_token={access_token}&org_id=999&recursion=true
[4].指定路径查询雇员信息,path每个节点均为为orgId,query匹配雇员名
/v1/admin/organizations/{code}/employees?access_token={access_token}&path=/111/222/333&query=aaa

返回数据

application/json
字段 类型 说明
domain_id String 域标识
user_id String 用户标识
name String 用户名
username String 用户账号
display_name 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. 访问令牌不存在

4. 雇佣雇员

POST

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

请求头

请求头 说明
Content-Type application/json

请求参数

字段 类型 是否必填 说明
access_token String Y 访问令牌
user_id String Y 用户标识
username String Y 账号
name String Y 雇员姓名
sn String N 雇员编号
mobile String N 手机号
email String N 邮箱
job_title String Y 职位信息
org_path String N 部门路径,与org_id不能同时为空
org_id Long N 部门ID,与org_path不能同时为空

请求示例

/v1/admin/organizations/a918d8a6-67e9-4e76-8503-baa73d3c6fd2/employees?access_token=b646339e2f4f4234af6bae5f72db9879
{
    "user_id":"3728f37f0f39436289668291e36a0656",
    "username":"13533545405",
    "name":"pangcg",
    "sn":"IMPL00001",
    "mobile":"",
    "email":"1231414324@qq.com",
     "positions":[{
        "job_title":"测试",
        "org_path":"XXX集团"
    }]
}

返回数据

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

错误返回值

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

5. 更新雇佣信息

POST

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

请求头

请求头 说明
Content-Type application/json

请求参数

字段 类型 是否必填 说明
access_token String Y 访问令牌
code String Y 组织orgCode
employeeId Long Y 雇员标识
ops String N 操作类型,为remove时删除
user_id String Y 用户标识
username String Y 账号
name String Y 雇员姓名
sn String N 雇员编号
mobile String N 手机号
email String N 邮箱
job_title String Y 职位信息
org_path String N 部门路径,与org_id不能同时为空
org_id Long N 部门ID,与org_path不能同时为空

请求示例

雇佣雇员
/v1/admin/organizations/a918d8a6-67e9-4e76-8503-baa73d3c6fd2/employees/740?access_token=b646339e2f4f4234af6bae5f72db9879
{
    "user_id":"3728f37f0f39436289668291e36a0656",
    "username":"13533545405",
    "name":"pangcg",
    "sn":"IMPL00001",
    "mobile":"",
    "email":"1231414324@qq.com",
     "positions":[{
        "job_title":"测试",
        "org_path":"XXX集团"
    }]
}
创建用户并雇佣雇员
/v1/admin/organizations/a918d8a6-67e9-4e76-8503-baa73d3c6fd2/employees/740?access_token=b646339e2f4f4234af6bae5f72db9879
{
    "name": "科学队长", 
    "username": "zhangsan99999", 
    "password":"123456",
    "email": "helloworld@world.com", 
    "mobile": "13876789876", 
    "positions": [
        {
            "job_title": "经理", 
            "org_path": "研发部"
        }
    ]
}

返回数据

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

错误返回值

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

6. 分页查询

GET

/v1/admins/organizations/{code}/page-employees?access_token={access_token}&skip={skip}&limit={limit}&refresh_time={refresh_time}

请求头

请求头 说明
Content-Type application/json

请求参数

字段 类型 是否必填 说明
access_token String Y 访问令牌
code String Y 组织orgCode
skip String N 开始记录数,默认值 0
limit String N 最大记录数,默认值 10
refresh_time String N 刷新时间戳,获取刷新时间以后的记录,默认值 -1

示例

/v1/admin/organizations/code/page-employees?access_token=8e0d7b9e4e4a49b888d6b0b5f882b7cd&skip=0&limit=10&refresh_time=-1

返回数据

{
    "status": 0,
    "message": "Everything is ok.",
    "result":{
        "total_count": 1,
        "employees":[
        {
            "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. 访问令牌不存在

results matching ""

    No results matching ""