文档中心 部门接口 批量添加部门

批量添加部门

1.功能说明

批量导入部门

2.接口调用说明

请求URL

https://openapi.guanaitong.tech/department/batchSynchronize

HTTP请求方式

POST

Content-Type: application/json

输入参数说明

(1)公共参数

发送请求是必须传入公共参数,详见公共参数

(2)私有参数

批量导入部门信息是放在一个数组里面,部门的信息如下:
参数名称 是否必须 参数类型 长度限制 描述
dept_code string [1,50] 部门编码
name string [1,100] 部门名称
status int [1] 部门是否有效,1有效、2无效
请求示例
POST /department/batchSynchronize?access_token=299f8488f7aab2626eb6c55115eaa04d&
        sign=d3fafff7b28435487e53d40bc6e7008a15b709c6&timestamp=1505979369 HTTP/1.1
Host: openapi.guanaitong.tech
Content-Type: application/json
Cache-Control: no-cache

[{"dept_code":"爱情部4","name":"xmg测试","status":"1"}]
                
返回参数说明
参数名称 描述
code 返回码。详见错误返回码
msg 如果错误,返回错误信息。
data 如果没有错误,返回部门编号
正确返回示例
{
    "code": 0,
    "data": "USERDOOR_BATCH_SET_PM_5a1ab36bc6b0e99f8726e99461db0429",
    "msg": "OK"
}
错误返回示例
{
    "code": 1000210001,
    "msg": "timestamp check failed!",
    "data": null
}