文档中心 > API类目 > 智慧园区API

alibaba.campus.core.department.getalldepttree (递归获取部门树)

递归获取部门树

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
work_bench_context WorkBenchContext 可选 平台统一权限校验
  • └ company_id
  • Number
  • 可选
  • 1
  • 公司id
  • └ campus_id
  • Number
  • 可选
  • 1
  • 园区id
deptment_id Number 可选 1 部门id

响应参数

名称 类型 示例值 描述
result PojoResult {} 请求响应
  • content
  • DeptmentTreeDto
  • {}
  • 响应内容
  • └ company_id
  • Number
  • 1
  • 公司id
  • └ short_name
  • String
  • 研发
  • 部门简称
  • └ dept_name_path
  • String
  • /阿里巴巴/研发部
  • 部门名称路径
  • └ super_dept_id
  • Number
  • 1
  • 父部门id
  • └ name
  • String
  • 研发部
  • 部门名称
  • └ id
  • Number
  • 1
  • 部门id
  • └ childs
  • String []
  • "{}"
  • 返回的是所有子部门信息,以树的形式展现。该返回参数为json字符串,需要做相应解析。
  • └ request_id
  • String
  • 1
  • 请求id
  • └ error_code
  • String
  • 200
  • 错误码
  • └ error_msg
  • String
  • ok
  • 错误信息
  • └ success
  • Boolean
  • true
  • 是否请求成功
  • └ error_ext_info
  • String
  • {"errormsg":"ok"}
  • 错误详情
  • └ error_level
  • String
  • 0
  • 错误等级

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaCampusCoreDepartmentGetalldepttreeRequest req = new AlibabaCampusCoreDepartmentGetalldepttreeRequest();
AlibabaCampusCoreDepartmentGetalldepttreeRequest.WorkBenchContext obj1 = new AlibabaCampusCoreDepartmentGetalldepttreeRequest.WorkBenchContext();
obj1.setCompanyId(1L);
obj1.setCampusId(1L);
req.setWorkBenchContext(obj1);
req.setDeptmentId(1L);
AlibabaCampusCoreDepartmentGetalldepttreeResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_campus_core_department_getalldepttree_response>
    <result>
        <content>
            <company_id>1</company_id>
            <short_name>研发</short_name>
            <dept_name_path>/阿里巴巴/研发部</dept_name_path>
            <super_dept_id>1</super_dept_id>
            <name>研发部</name>
            <id>1</id>
            <childs>
                <string>&quot;{}&quot;</string>
            </childs>
        </content>
        <request_id>1</request_id>
        <error_code>200</error_code>
        <error_msg>ok</error_msg>
        <success>true</success>
        <error_ext_info>{&quot;errormsg&quot;:&quot;ok&quot;}</error_ext_info>
        <error_level>0</error_level>
    </result>
</alibaba_campus_core_department_getalldepttree_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部