智慧服务,成就美好体验 项目咨询

主页 > 服务与支持 > 开发平台 > 服务端API参考 > 企业部门管理 > 查询部门及其一级子部门裂变 查询部门及其一级子部门列表

入门使用

查询部门及其一级子部门列表

更新时间:2019-11-20

描述

企业管理员通过该接口查询部门及其一级子部门列表。

接口原型

表1 接口原型

请求方法

GET

请求地址

/rest/usg/datacenter/v1/member/dept/{deptCode}

传输协议

HTTPS

请求参数

表2 参数说明

参数

是否必须

类型

位置

描述

Authorization

String

Header

授权令牌。将执行鉴权响应的accessToken

进行Base64转码操作

样例:Basic Base64(accessToken)

deptCode

String

URL

部门编码。

长度: 0-32位。

响应参数

表3 参数说明

参数

类型

描述

returnCode

String

业务返回码。

returnMessage

String

返回描述。

achievementTime

String

响应产生时间。

requestId

String

请求唯一标识。

data

QueryDeptTreeResultDTO

查询部门列表,返回该部门及其子部门。

表4 QueryDeptTreeResultDTO 数据结构

参数

类型

描述

corpId

String

企业ID。

deptCode

String

部门编码。

deptLevel

Integer

部门层级。

deptName

String

部门名称。

deptNamePath

String

部门路径。

isLeafNode

Boolean

是否叶子。

parentDeptCode

String

父部门编号。

deptCodePath

String

部门编码路径。

note

String

备注。

childDepts

QueryDeptResultDTO[0..*]

子部门列表。

表5 QueryDeptResultDTO 数据结构

参数

类型

描述

deptCode

String

部门编码,企业内唯一。

deptLevel

Integer

部门层级。

deptName

String

部门名称。

deptNamePath

String

部门路径。

isLeafNode

Boolean

是否叶子。

parentDeptCode

String

父部门编号。

deptCodePath

String

部门编码路径。

note

String

备注。

corpId

String

企业ID。

请求消息示例

GET /rest/usg/datacenter/v1/member/dept/27b
Connection: keep-alive
Authorization: Basic OENmOVBFUXZZV29ZMnVZYXQzdXVUcjhxdW9WYWdQSkJ4
Host: api.meeting.huaweicloud.com 
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_191)
 

响应消息示例

HTTP/1.1 200 
Date: Thu, 12 Apr 2019 08:37:33 GMT
Content-Type: application/json;charset=UTF-8
Connection: keep-alive
Pragma: No-cache
Cache-Control: no-cache
Server: api-gateway
X-Request-Id: 539e8b710378987ffc5eb844b5e5c290

{
    "returnCode": "000000000",
    "returnMessage": "Success",
    "achievementTime": "2019-04-12 08:37:33.388",
    "requestId": "50544b84385b553b1054e05adc2a970f",
    "data": {
        "corpId": "42019",
        "deptCode": "27b",
        "deptLevel": 2,
        "deptName": "111111",
        "deptNamePath": "user001#111111",
        "isLeafNode": true,
        "parentDeptCode": "1",
        "deptCodePath": "1#27b",
        "note": "string",
        "childDepts": []
    }
}
 

CURL命令示例

curl -k -i -X GET -H 'Authorization: Basic VUVwVU82SWFISU0ySWlKaEdoRllRUXk0MUZnbk00Mkpk' https://api.meeting.huaweicloud.com/rest/usg/datacenter/v1/member/dept/27b