Skip to content

更新待入职信息(不推荐)

更新待入职信息接口,本接口只是会更新待入职数据,不会校验数据规则,推荐使用新接口【更新待入职信息】

请求

项目
HTTP URLhttps://open.feishu.cn/open-apis/corehr/v1/pre_hires/:pre_hire_id
HTTP MethodPATCH
接口频率限制100 次/分钟
支持的应用类型custom
权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 开启任一权限即可corehr:corehr 更新核心人事信息 corehr:pre_hire:write 读写待入职人员信息

请求头

名称类型必填描述
Authorizationstringtenant_access_token 值格式:"Bearer access_token" 示例值:"Bearer t-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token
Content-Typestring固定值:"application/json; charset=utf-8"

路径参数

名称类型描述
pre_hire_idstring待入职ID
示例值:"1616161616"

查询参数

名称类型必填描述
client_tokenstring根据client_token是否一致来判断是否为同一请求
示例值:12454646

请求体

名称类型必填描述
ats_application_idstring招聘投递 ID ,详细信息可以通过招聘的【获取投递信息】接口查询获得(仅部分租户可用)
示例值:"4719168654814483759"
hire_datestring入职日期
示例值:"2020-01-01"
employee_typeenum雇佣类型
  └ enum_namestring枚举值
示例值:"type_1"
worker_idstring人员编号
示例值:"1245646"
employee_type_idstring雇佣类型
示例值:"正式"
person_idstring引用Person ID
示例值:"656464648662"
custom_fieldsobject_field_data\[\]自定义字段
  └ field_namestring字段名
示例值:"name"
  └ valuestring字段值,是json转义后的字符串,根据元数据定义不同,字段格式不同(如123, 123.23, "true", ["id1","id2"], "2006-01-02 15:04:05")
示例值:""Sandy""
cost_center_ratesupport_cost_center_item\[\]成本中心分摊信息
  └ cost_center_idstring支持的成本中心id
示例值:"6950635856373745165"
  └ rateint分摊比例
示例值:100
onboarding_statusenum入职状态
- 待入职(preboarding)
- 已删除(deleted)
- 准备就绪(day_one)
- 已撤销(withdrawn)
- 已完成(completed)
  └ enum_namestring枚举值
示例值:"type_1"

请求体示例

json
{
    "ats_application_id": "4719168654814483759",
    "hire_date": "2020-01-01",
    "employee_type": {
        "enum_name": "type_1"
    },
    "worker_id": "1245646",
    "employee_type_id": "正式",
    "person_id": "656464648662",
    "custom_fields": [
        {
            "field_name": "name",
            "value": "\"Sandy\""
        }
    ],
    "cost_center_rate": [
        {
            "cost_center_id": "6950635856373745165",
            "rate": 100
        }
    ],
    "onboarding_status": {
        "enum_name": "type_1"
    }
}

响应

响应体

名称类型描述
codeint错误码,非 0 表示失败
msgstring错误描述
data\--
  └ pre_hirepre_hire待入职数据
    └ ats_application_idstring招聘投递 ID ,详细信息可以通过招聘的【获取投递信息】接口查询获得
    └ idstring待入职ID
    └ hire_datestring入职日期
    └ employee_typeenum雇佣类型
      └ enum_namestring枚举值
      └ displayi18n\[\]枚举多语展示
        └ langstring名称信息的语言
        └ valuestring名称信息的内容
    └ worker_idstring人员编号
    └ employee_type_idstring雇佣类型
    └ person_idstring引用Person ID
    └ custom_fieldsobject_field_data\[\]自定义字段
      └ field_namestring字段名
      └ valuestring字段值,是json转义后的字符串,根据元数据定义不同,字段格式不同(如123, 123.23, "true", ["id1","id2"], "2006-01-02 15:04:05")
    └ cost_center_ratesupport_cost_center_item\[\]成本中心分摊信息
      └ cost_center_idstring支持的成本中心id
      └ rateint分摊比例
    └ onboarding_statusenum入职状态
- 待入职(preboarding)
- 已删除(deleted)
- 准备就绪(day_one)
- 已撤销(withdrawn)
- 已完成(completed)
      └ enum_namestring枚举值
      └ displayi18n\[\]枚举多语展示
        └ langstring名称信息的语言
        └ valuestring名称信息的内容

响应体示例

json
{
    "code": 0,
    "msg": "success",
    "data": {
        "pre_hire": {
            "ats_application_id": "4719168654814483759",
            "id": "154545454",
            "hire_date": "2020-01-01",
            "employee_type": {
                "enum_name": "type_1",
                "display": [
                    {
                        "lang": "zh-CN",
                        "value": "刘梓新"
                    }
                ]
            },
            "worker_id": "1245646",
            "employee_type_id": "正式",
            "person_id": "656464648662",
            "custom_fields": [
                {
                    "field_name": "name",
                    "value": "\"Sandy\""
                }
            ],
            "cost_center_rate": [
                {
                    "cost_center_id": "6950635856373745165",
                    "rate": 100
                }
            ],
            "onboarding_status": {
                "enum_name": "type_1",
                "display": [
                    {
                        "lang": "zh-CN",
                        "value": "刘梓新"
                    }
                ]
            }
        }
    }
}

错误码

HTTP状态码错误码描述排查建议
4001161019Duplicate cost centerPlease check cost_center_id in cost_center_rate
4001161020The number of allocation proportion must be an integer from 1 to 100Please check rate in cost_center_rate
4001161021Incomplete cost center dataPlease check cost_center_rate
4001161022No cost centers foundPlease check cost_center_id in cost_center_rate
4001161023The total allocation proportion of all cost centers must be 100%Please check the sum of rate in cost_center_rate
4001161024Cost center is deactivatedPlease check cost_center_id in cost_center_rate
4001161025Cost center will be disabledPlease check cost_center_id in cost_center_rate
5001160025Please check descriptionPlease check suggestion

内容来源:飞书开放平台 · 自动爬取整理