Skip to content

启用或停用岗位

对岗位进行启用或停用操作

请求

项目
HTTP URLhttps://open.feishu.cn/open-apis/corehr/v2/positions/active
HTTP MethodPOST
接口频率限制5 次/秒
支持的应用类型custom,isv
权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用corehr:position:write 读写岗位信息

请求头

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

请求体

名称类型必填描述
position_idstring岗位ID,详细信息可通过查询岗位信息接口获得
示例值:"6862995757234914823"
activeboolean可选值:true(启用)、false(停用)
示例值:true
effective_timestring版本生效时间
示例值:"2020-01-01"
数据校验规则
- 长度范围:1010 字符 - 正则校验:`^((([0-9]{3}[1-9]

请求体示例

json
{
    "position_id": "6862995757234914823",
    "active": true,
    "effective_time": "2020-01-01"
}

响应

响应体

名称类型描述
codeint错误码,非 0 表示失败
msgstring错误描述
data\--

响应体示例

json
{
    "code": 0,
    "msg": "success",
    "data": {}
}

错误码

HTTP状态码错误码描述排查建议
4001160285Failed to disable as it still has active employees after the deactivation effective time.在停用生效日期后,此岗位仍有在职人员,请检查该岗位在停用生效日期后的在职人员列表,移除或调整相关人员后重试
4001160267Activation date cannot be earlier than the effective date of the last deactivated version启用生效日期不可早于最后一个版本生效日期,请检查最后一个版本的生效日期,并确保当前设置的启用生效日期不早于该日期后重试
4001160104Record doesn't exist记录不存在,请检查传入的记录ID是否正确或确认记录是否存在
4001160281Failed to disable as 1 or more members of it are in a job status change process after the current deactivation date停用失败。在停用生效日期后,此岗位仍有在途的异动,请检查该岗位在停用生效日期后的在途异动列表,处理完毕后重试
4001160269Effective date can't be later than the year 9999生效日期不能晚于9999年,请修改生效日期为9999年12月31日或之前
4001160353Effective Date cannot earlier than 1900生效日期不能早于1900年,请修改生效日期为1900年1月1日或之后
4001160501Failed to disable as it still has sub position(s) after the deactivation effective time.停用失败。在停用生效日期后,此岗位仍有生效的下级岗位,请检查该岗位在停用生效日期后的下级岗位列表,移除或调整相关岗位后重试
4001160508Failed to disable. As the position still has pre-hires after the deactivation effective time.停用失败。在停用生效日期后,此岗位仍有人员将入职,请检查该岗位在停用生效日期后的预入职人员列表,处理完毕后重试
4001160268Effective date for disabling the position can't be earlier than the effective date of the last version停用生效日期不可早于最后一个版本生效日期,请检查最后一个版本的生效日期并调整停用生效日期
4001161200There are still enabled subordinates on the current deactivation date停用失败。在停用生效日期后,此岗位仍有在职员工,请检查该岗位在停用生效日期后的在职员工列表,移除或调整相关员工后重试
4001160266Effective date must be later than the first effective date生效日期必须晚于第一个版本的生效日期,请检查第一个版本的生效日期,并调整当前生效日期至其之后重试
4291161604QPS over limitQPS 超出限制,请降低请求频率重试,必要时请联系 技术支持

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