跳转至

删除部门

功能说明

删除部门

接口地址

HTTP请求方式

  • Method: POST
  • Content-Type: application/x-www-form-urlencoded

参数说明

  • 公有参数

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

  • 私有参数

参数名称 是否必须 参数类型 长度限制 描述
enterprise_code string [1,20] 企业编号(集团必填,企业无需填写)
dept_code string [1,50] 部门编码

请求示例(HTTP)

POST /department/delete HTTP/1.1
Host: openapi.guanaitong.tech
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

access_token=6007bf4c6efeb798da35b843e4614cff&sign=dc2cb643d101d8ae96e857ff4ca24de23bf4f27f&
timestamp=1495094685&dept_code=S100

请求示例(JAVA SDK)

public class Main {
    public static OpenClient openClient = new OpenClient(Constants.BASE_URL_TEST, "xxx", "xxx");
    public static void main(String[] args) {
        DepartmentDeleteRequest departmentDeleteRequest = new DepartmentDeleteRequest();
        departmentDeleteRequest.setDeptCode("DEPT_0825_03");
        String data = openClient.departmentApi().delete(departmentDeleteRequest);
        System.out.println(data);
    }
}

返回参数说明

参数名称 描述
code 返回码。详见错误返回码
msg 如果错误,返回错误信息。
data 如果没有错误,返回部门编号

正确返回示例

{
    "code": 0,
    "data": "S100",
    "msg": "OK"
}

错误返回示例

{
    "code": 1000220010,
    "msg": "dept_code not exists !",
    "data": null
}

常见错误码

错误码 错误信息 排查方法
1000220002 参数验证不通过 检测参数是否按要求填写
1000220010 dept_code not exists ! 检测部门是否成功添加
1002200106 无权限 检测部门是否存在当前企业
1002212002 基础部门不能被删除 根部门不能被删除
1000240002 enterprise_code校验失败 检查enterprise_code是否是已绑定的编码
other 其他公共错误码 其他公共错误码
回到页面顶部