根据工号,修改企业平台上员工的信息
注意:
(1)工号(corp_code)只支持字母数字,不区分大小写。建议企业用不变且唯一的标识作为工号;
(2)手机号(mobile)(建议填写)为11位数字,限于运营商因素,国外手机号暂不支持短信通知。
https://openapi.guanaitong.tech/employee/update
POST
(1)公共参数
发送请求是必须传入公共参数,详见公共参数
(2)私有参数
| 参数名称 | 是否必须 | 参数类型 | 长度限制 | 描述 |
| corp_code | 否 | string | [1,20] | 员工工号 |
| userid | 否 | string | [1,100] | 员工第三方唯一标识,工号和唯一标识必填其一 |
| new_corp_code | 否 | string | [1,20] | 新的员工工号(将旧的工号修改此新的工号) |
| enterprise_code | 否 | string | [1,20] | 企业编号(集团和运营商同步,企业不填) |
| name | 否 | string | [1,50] | 员工姓名 |
| gender | 否 | int | [1] | 性别,1:男;2:女;3:未知 |
| 否 | string | [1,100] | 邮箱,企业内唯一 | |
| mobile_area | 否 | int | [1,10] | 手机区号,国外手机同步,不填默认为国内手机区号(86) |
| mobile | 否 | string | [6,20] | 手机,企业内唯一 |
| remark | 否 | string | [0,254] | 备注 |
| dept_code | 否 | string | [1,50] | 部门编号 |
| level | 否 | string | [1,50] | 员工分级(若传空字符串,则将该员工分级置空)(需先在企业后台开启该功能) |
| category | 否 | string | [] | 员工分类,多个分类,用“,”分割(若传空字符串,则将该员工分类置空)(需先在企业后台开启该功能) |
| birth_day | 否 | string | [10] | 生日,格式为yyyy-MM-dd,如:1991-01-01 |
| entry_day | 否 | string | [10] | 入职日,格式为yyyy-MM-dd,如:2016-02-03 |
| card_type | 否 | int | [1] | 证件类型,1-身份证,2-护照,3-香港居民身份证,4-澳门居民身份证,5-台湾身份证,6-台胞证,7-回乡证 |
| card_no | 否 | string | [1,30] | 证件号码 |
| extattr | 否 | string | 无 | 第三方绑定,JsonArray,格式如: List«ThirdUser»(需先绑定第三方平台) |
| employee_attribute | 否 | string | 无 | 扩展信息,JsonArray,格式如: List«EmployeeAttribute»(需先确认扩展信息已启用的字段,合同性质、固定电话、级别、分类等默认已启用) |
| cost_center_id | 否 | int | [1,10] | 成本中心id,取值范围1~2147483647之间的整数 |
(3)extattr中的ThirdUser对象
| 参数名称 | 是否必须 | 参数类型 | 长度限制 | 描述 |
| thirdType | 是 | string | [1] | 第三方类型,目前仅支持 1.企业微信 2.钉钉 |
| userId | 是 | string | [1,100] | 第三方中的userId |
(4)employee_attribute中的EmployeeAttribute对象
| 参数名称 | 是否必须 | 参数类型 | 长度限制 | 描述 |
| attributeCode | 是 | string | [1,100] | 扩展字段编号,如:contractNature(合同性质) taxpayerMapper(纳税人归属) |
| attributeValue | 是 | string | [1,100] | 扩展字段值,如:contractNature对应: 正式员工,试用员工,临时员工,实习生,兼职员工,外聘员工 taxpayerMapper对应纳税人归属id |
POST /employee/update HTTP/1.1
Host: openapi.guanaitong.tech
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache
access_token=d557ea2ff6fb2e78e45e14e8f5062b5a&birth_day=1991-02-20&card_no=371322199105204123&
card_type=1&corp_code=CJJ200&cost_center_id=1234&departmentId=1797&dept_code=A001&level=S1&email=654321@qq.com&
entry_day=2016-10-01&gender=1&mobile_area=86&mobile=15588756223&name=zhangSan&new_corp_code=CJJ666&
timestamp=1492419521&remark=添加员工&sign=07b86548dc6169a07a6d0f2414e46aedd14d4a40&
| 参数名称 | 描述 |
| code | 返回码。详见错误返回码。 |
| msg | 如果错误,返回错误信息。 |
| data | 如果没有错误,返回业务数据-工号。 |
{
"code": 0,
"data": "CJJ200",
"msg": "OK"
}
{
"code": 1000210006,
"data": null,
"msg": "parameter check failed!"
}