人事异动

获取员工异动信息


使用场景:该接口用于返回员工异动信息。

请求方式:GET(HTTPS)

请求地址:https://openapi.2haohr.com/api/emp_transfer/?access_token=ACCESS_TOKEN

参数说明:

参数 类型 是否必须 说明
access_token String 调用接口凭证
ids String 员工id,使用逗号隔开,一次最多支持100

权限说明

返回结果:

{
  "errcode": 0,
  "errmsg": "",
  "data": [
        {
            "task_number": "",
            "employee_id": "72a5f7******46d5bd78******8207b4",
            "task_date": "2020-07-22",
            "content": "毛5于2020-07-22调岗,部门由无变更为广东省,岗位由无变更为产品经理,异动原因:工作安排",
            "task_type": 1,
            "transfer_reason": "工作安排"
        },
        {
            "task_number": null,
            "employee_id": "de6e00******4d6b8695******2c3f24",
            "task_date": "2020-05-22",
            "content": "贾似真为尽快看看办理了转正,转正日期:2020-05-22",
            "task_type": 6,
            "transfer_reason": null
        }
    ]
}

参数说明:

参数 说明
errcode 返回码
errmsg 对返回码的文本描述内容
data 返回数据
task_number 审批单号
employee_id 员工id
task_date 异动日期
content 异动详情
task_type 异动类型 1:调岗,2:晋升,3:降级,4:离职,5:入职,6:转正,8:转全职员工
transfer_reason 异动原因

员工批量解除合同信息


使用场景:该接口用于将企业OA系统内生成的解除员工合同信息同步写入2号系统。

请求方式:POST(HTTPS)

请求地址:https://openapi.2haohr.com/api/employees/contract_list/terminate/?access_token=ACCESS_TOKEN

请求包结构体为:

{
    "tf_type": "ctr_terminate",
    "emp_list": [
        {
            "id": "2d9d84*****d4066b7272*****b9c8ff", 
            "tf_dt": "2019-01-02", 
            "remark": "",
            "contract_ids": ["e34100*****842bf8b2ac*****560ee7"]
        }
    ]
}

参数说明:

参数 类型 是否必须 说明
access_token String 调用接口凭证
tf_type String 异动类型 ctr_terminate
emp_list List 员工列表,最多100条数据
emp_list中包含参数
tf_dt String 合同解除日期,只支持如"2018-01-01"这种写法
id String 员工id
remark String 备注
contract_ids List 合同id列表

权限说明

返回结果:

{
  "errcode": 0,
  "errmsg": "",
  "data": {
    "msg": "批量解除完成"
  }
}

参数说明:

参数 说明
errcode 返回码
errmsg 对返回码的文本描述内容
data 返回数据
msg 返回信息

员工批量转正


使用场景:该接口用于将企业OA系统内生成的转正信息同步写入2号系统。

请求方式:POST(HTTPS)

请求地址:https://openapi.2haohr.com/api/emp_transfer/change_status/?access_token=ACCESS_TOKEN

请求包结构体为:

{
    "tf_type": "formal",
    "is_transfer": true,
    "emp_list": [
        {
            "id": "2d9d84*****d4066b7272*****b9c8ff", 
            "formal_dt": "2019-01-02", 
            "remark": "批量转正",
            "tf_number": "008"
        },
        {
            "id": "943a48*****a4591808f6*****7423e1", 
            "formal_dt": "2018-11-02", 
            "remark": "批量转正",
            "tf_number": "009"
        }
    ]
}

参数说明:

参数 类型 是否必须 说明
access_token String 调用接口凭证
tf_type String 异动类型 formal
is_transfer Bool 是否生成转正任务,即是否需要2号这边使用定时任务执行,默认true, 必须为true,暂不支持直接变动数据
emp_list List 员工列表,最多100条数据
emp_list中包含参数
formal_dt String 转正日期,只支持如"2018-01-01"这种写法
id String 员工id
remark String 备注
tf_number String 审批编号

权限说明

返回结果:

{
  "errcode": 0,
  "errmsg": "",
  "data": {
    "msg": "批量转正成功!"
  }
}

参数说明:

参数 说明
errcode 返回码
errmsg 对返回码的文本描述内容
data 返回数据
msg 返回信息

员工批量离职


使用场景:该接口用于将企业OA系统内生成的离职信息写入2号系统。

请求方式:POST(HTTPS)

请求地址:https://openapi.2haohr.com/api/emp_transfer/change_status/?access_token=ACCESS_TOKEN

请求包结构体为:

{
    "tf_type": "leave",
    "is_transfer": true,
    "emp_list": 
        [
            {
                "id": "2d9d84*****d4066b7272*****b9c8ff", 
                "leave_dt": "2019-01-02", 
                "apply_dt": "2019-01-02",
                "salary_dt": "2019-01-02",
                "leave_type": "33e6c7*****d4154ab58c*****49d914",
                "leave_type_name": "主动离职",
                "leave_reason": 1, 
                "reason_desc": "个人家庭矛盾需解决",
                "leave_reason_name": "家庭原因",
                "leave_direction": "", 
                "remark": "",
                "tf_number": "009"
            }
        ]
}

参数说明:

参数 类型 是否必须 说明
access_token String 调用接口凭证
tf_type String 异动类型 leave
is_transfer Bool 是否生成离职任务,即是否需要2号这边使用定时任务执行,默认true, 必须为true,暂不支持直接变动数据
emp_list List 员工列表,最多100条数据
emp_list中包含参数
leave_dt String 离职日期,只支持如"2018-01-01"这种写法
apply_dt String 申请离职日期,只支持如"2018-01-01"这种写法
salary_dt String 薪酬结算日期,只支持如"2018-01-01"这种写法
id String 员工id
leave_type String 离职类型id,离职类型与离职类型名称至少存在一个,且leave_type的优先级大于leave_type_name
leave_type_name String 离职类型名称,离职类型与离职类型名称至少存在一个
remark String 备注
leave_reason Int 离职原因id,离职原因与离职原因名称至少存在一个,且leave_reason的优先级大于leave_reason_name
leave_reason_name String 离职原因名称,离职原因与离职原因名称至少存在一个
reason_desc String 离职原因说明
leave_direction String 离职去向
tf_number String 审批编号

权限说明

返回结果:

{
  "errcode": 0,
  "errmsg": "",
  "data": {
    "msg": "批量离职成功!"
  }
}

参数说明:

参数 说明
errcode 返回码
errmsg 对返回码的文本描述内容
data 返回数据
msg 返回信息

员工批量调岗


使用场景:该接口用于将企业OA系统内生成的人事异动-调岗信息同步写入2号系统。

请求方式:POST(HTTPS)

请求地址:https://openapi.2haohr.com/api/emp_transfer/change_status/?access_token=ACCESS_TOKEN

请求包结构体为:

{
    "tf_type": "job",
    "is_transfer": true,
    "emp_list": [
        {
            "id": "2d9d84*****d4066b7272*****b9c8ff", 
            "tf_dt": "2019-01-02", 
            "tf_dep_id": "bea9d6*****b4df19d607*****8cca92",
            "tf_dep_name": "研发中心",
            "tf_title_id": "0b594d*****e4296b8e55*****4f2283",
            "tf_title_name": "产品经理",
            "tf_level_id": "28064a*****e42f6bd857*****ae3a25", 
            "tf_level_name": "P-1",
            "tf_place_id": "异动后工作地点",
            "tf_place_name": "工作地点名称",
            "tf_ct_com_id": "38a0b6*****c4a1f8edc7*****30119a", 
            "tf_ct_com_name": "国美有限公司",
            "remark": "异动备注",
            "tf_reason": "组织架构调整",
            "tf_number": "008"
        }
    ]
}

参数说明:

参数 类型 是否必须 说明
access_token String 调用接口凭证
tf_type String 异动类型 job
is_transfer Bool 是否生成调岗定时任务,即是否需要2号这边使用定时任务执行,默认true, 必须为true,暂不支持直接变动数据
emp_list List 员工列表,最多10条数据
emp_list中包含参数
tf_dt String 生效日期,只支持如"2018-01-01"这种写法
tf_dep_id String 异动后部门id
tf_dep_name String 异动后部门名称
tf_level_id String 异动后职级id
tf_level_name String 异动后职级名称
tf_title_id String 异动后岗位id
tf_title_name String 异动后岗位名称
tf_place_id String 异动后工作地点id
tf_place_name String 异动后工作地点名称
tf_ct_com_id String 异动后合同公司id
tf_ct_com_name String 异动后合同公司名称
id String 员工id
remark String 备注
tf_reason String 异动原因
tf_number String 审批编号

权限说明

返回结果:

{
  "errcode": 0,
  "errmsg": "",
  "data": {
    "msg": "批量调岗成功!"
  }
}

参数说明:

参数 说明
errcode 返回码
errmsg 对返回码的文本描述内容
data 返回数据
msg 返回信息

员工批量晋升


使用场景:该接口用于将企业OA系统内生成的人事异动-晋升信息同步写入2号系统。

请求方式:POST(HTTPS)

请求地址:https://openapi.2haohr.com/api/emp_transfer/change_status/?access_token=ACCESS_TOKEN

请求包结构体为:

{
    "tf_type": "promotion",
    "is_transfer": true,
    "emp_list": [
        {
            "id": "2d9d84*****d4066b7272*****b9c8ff", 
            "tf_dt": "2019-01-02", 
            "tf_dep_id": "bea9d6*****b4df19d607*****8cca92",
            "tf_dep_name": "研发中心",
            "tf_title_id": "0b594d*****e4296b8e55*****4f2283",
            "tf_title_name": "产品经理",
            "tf_level_id": "28064a*****e42f6bd857*****ae3a25", 
            "tf_level_name": "P-1",
            "tf_place_id": "异动后工作地点",
            "tf_place_name": "工作地点名称",
            "tf_ct_com_id": "38a0b6*****c4a1f8edc7*****30119a", 
            "tf_ct_com_name": "国美有限公司",
            "remark": "异动备注",
            "tf_reason": "组织架构调整",
            "tf_number": "008"
        }
    ]
}

参数说明:

参数 类型 是否必须 说明
access_token String 调用接口凭证
tf_type String 异动类型 promotion
is_transfer Bool 是否生成晋升定时任务,即是否需要2号这边使用定时任务执行,默认true, 必须为true,暂不支持直接变动数据
emp_list List 员工列表,最多10条数据
emp_list中包含参数
tf_dt String 生效日期,只支持如"2018-01-01"这种写法
tf_dep_id String 异动后部门id
tf_dep_name String 异动后部门名称
tf_level_id String 异动后职级id
tf_level_name String 异动后职级名称
tf_title_id String 异动后岗位id
tf_title_name String 异动后岗位名称
tf_place_id String 异动后工作地点id
tf_place_name String 异动后工作地点名称
tf_ct_com_id String 异动后合同公司id
tf_ct_com_name String 异动后合同公司名称
id String 员工id
remark String 备注
tf_reason String 异动原因
tf_number String 审批编号

权限说明

返回结果:

{
  "errcode": 0,
  "errmsg": "",
  "data": {
    "msg": "批量晋升成功!"
  }
}

参数说明:

参数 说明
errcode 返回码
errmsg 对返回码的文本描述内容
data 返回数据
msg 返回信息

员工批量降级


使用场景:该接口用于将企业OA系统内生成的人事异动-降级信息同步写入2号系统。

请求方式:POST(HTTPS)

请求地址:https://openapi.2haohr.com/api/emp_transfer/change_status/?access_token=ACCESS_TOKEN

请求包结构体为:

{
    "tf_type": "demotion",
    "is_transfer": true,
    "emp_list": [
        {
            "id": "2d9d84*****d4066b7272*****b9c8ff", 
            "tf_dt": "2019-01-02", 
            "tf_dep_id": "bea9d6*****b4df19d607*****8cca92",
            "tf_dep_name": "研发中心",
            "tf_title_id": "0b594d*****e4296b8e55*****4f2283",
            "tf_title_name": "产品经理",
            "tf_level_id": "28064a*****e42f6bd857*****ae3a25", 
            "tf_level_name": "P-1",
            "tf_place_id": "异动后工作地点",
            "tf_place_name": "工作地点名称",
            "tf_ct_com_id": "38a0b6*****c4a1f8edc7*****30119a", 
            "tf_ct_com_name": "国美有限公司",
            "remark": "异动备注",
            "tf_reason": "组织架构调整",
            "tf_number": "008"
        }
    ]
}

参数说明:

参数 类型 是否必须 说明
access_token String 调用接口凭证
tf_type String 异动类型 demotion
is_transfer Bool 是否生成降级定时任务,即是否需要2号这边使用定时任务执行,默认true, 必须为true,暂不支持直接变动数据
emp_list List 员工列表,最多10条数据
emp_list中包含参数
tf_dt String 生效日期,只支持如"2018-01-01"这种写法
tf_dep_id String 异动后部门id
tf_dep_name String 异动后部门名称
tf_level_id String 异动后职级id
tf_level_name String 异动后职级名称
tf_title_id String 异动后岗位id
tf_title_name String 异动后岗位名称
tf_place_id String 异动后工作地点id
tf_place_name String 异动后工作地点名称
tf_ct_com_id String 异动后合同公司id
tf_ct_com_name String 异动后合同公司名称
id String 员工id
remark String 备注
tf_reason String 异动原因
tf_number String 审批编号

权限说明

返回结果:

{
  "errcode": 0,
  "errmsg": "",
  "data": {
    "msg": "批量降级成功!"
  }
}

参数说明:

参数 说明
errcode 返回码
errmsg 对返回码的文本描述内容
data 返回数据
msg 返回信息

员工批量转全职


使用场景:该接口用于将企业OA系统内生成的人事异动-转全职信息同步写入2号系统。

请求方式:POST(HTTPS)

请求地址:https://openapi.2haohr.com/api/emp_transfer/change_status/?access_token=ACCESS_TOKEN

请求包结构体为:

{
    "tf_type": "full",
    "is_transfer": true,
    "emp_list": [
        {
            "id": "2d9d84*****d4066b7272*****b9c8ff", 
            "tf_dt": "2019-01-02", 
            "probation": "",
            "tf_dep_id": "bea9d6*****b4df19d607*****8cca92",
            "tf_dep_name": "研发中心",
            "tf_title_id": "0b594d*****e4296b8e55*****4f2283",
            "tf_title_name": "产品经理",
            "tf_level_id": "28064a*****e42f6bd857*****ae3a25", 
            "tf_level_name": "P-1",
            "tf_place_id": "异动后工作地点",
            "tf_place_name": "工作地点名称",
            "tf_ct_com_id": "38a0b6*****c4a1f8edc7*****30119a", 
            "tf_ct_com_name": "国美有限公司",
            "remark": "异动备注",
            "tf_reason": "组织架构调整",
            "tf_number": "008"
        }
    ]
}

参数说明:

参数 类型 是否必须 说明
access_token String 调用接口凭证
tf_type String 异动类型 full
is_transfer Bool 是否生成转全职定时任务,即是否需要2号这边使用定时任务执行,默认true, 必须为true,暂不支持直接变动数据
emp_list List 员工列表,最多10条数据
emp_list中包含参数
tf_dt String 生效日期,只支持如"2018-01-01"这种写法
probation Number 试用期
tf_dep_id String 异动后部门id
tf_dep_name String 异动后部门名称
tf_level_id String 异动后职级id
tf_level_name String 异动后职级名称
tf_title_id String 异动后岗位id
tf_title_name String 异动后岗位名称
tf_place_id String 异动后工作地点id
tf_place_name String 异动后工作地点名称
tf_ct_com_id String 异动后合同公司id
tf_ct_com_name String 异动后合同公司名称
id String 员工id
remark String 备注
tf_reason String 异动原因
tf_number String 审批编号

权限说明

返回结果:

{
  "errcode": 0,
  "errmsg": "",
  "data": {
    "msg": "批量转全职成功!"
  }
}

参数说明:

参数 说明
errcode 返回码
errmsg 对返回码的文本描述内容
data 返回数据
msg 返回信息