查询部门列表
查询部门列表信息。
请求 URL
GET {base_url}/{api_path}/organization/list?access_token={access_token}
请求参数
| 参数 | 是否必填 | 类型 | 说明 |
|---|---|---|---|
| page | 否 | Integer | 定义显示第几个页面。 |
| page_size | 否 | Integer | 定义每页显示几项查询结果。 |
| sort_by | 否 | String | 定义排序字段。 取值范围: |
| order_by | 否 | String | 定义显示顺序。 取值范围:
|
| is_all | 否 | Integer | 是否返回完整信息。 取值范围:
|
响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| errcode | Integer | 返回错误码。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息。
|
| errmsg | String | 返回信息。
|
| organization_list | Array<Organization_List> | 部门信息。 |
- Organization_List
-
表 3. 参数 类型 说明 id Integer 部门的唯一 ID。 name String 部门名称。 parent_id Integer 父部门的唯一 ID。 order Integer 部门序号。 ext_number Integer 部门中包含的分机总数。 注: 此参数仅在is_all参数值为0或1时返回。children Array<Sub_Organization> 子部门信息。 ext_list Array<Integer> 部门中包含的分机列表。 注: 此参数仅在is_all参数值为1时返回。 - Sub_Organization
-
表 4. 参数 类型 说明 id Integer 部门的唯一 ID。 name String 部门名称。 parent_id String 父部门的唯一 ID。 order String 部门序号。 ext_number String 部门中包含的分机总数。 注: 此参数仅在is_all参数值为0或1时返回。children Array<Sub_Organization> 子部门信息。 ext_list Array<Integer> 部门中包含的分机列表。 注: 此参数仅在is_all参数值为1时返回。
示例
请求示例
GET /openapi/v1.0/organization/list?access_token=GseU7IyuT2nxJQ8NfReyF24rdknvVrOm&is_all=1 HTTP/1.1
Host: yeastardocs.example.yeastarcloud.com
响应示例
HTTP/1.1 200 OK { "errcode": 0, "errmsg": "SUCCESS", "organization_list": [ { "id": 1, "name": "Demo", "parent_id": 0, "order": 1, "ext_number": 17, "children": [ { "id": 12, "name": "Marketing Center", "parent_id": 1, "order": 1, "ext_number": 14, "children": [ { "id": 17, "name": "Tech Support", "parent_id": 12, "order": 1, "ext_number": 8, "ext_list": [ 75, 76, 39, 77, 62, 63, 65, 66 ] }, { "id": 18, "name": "Training Team", "parent_id": 12, "order": 2, "ext_number": 3, "ext_list": [ 38, 41, 57 ] }, { "id": 13, "name": "Marketing Team", "parent_id": 12, "order": 3, "ext_number": 3, "ext_list": [ 59, 60, 61 ] } ], "ext_list": [ 75, 76, 39, 77, 62, 63, 65, 66, 38, 41, 57, 59, 60, 61 ] }, { "id": 15, "name": "Research & Development Center", "parent_id": 1, "order": 2, "ext_number": 3, "children": [ { "id": 21, "name": "Test", "parent_id": 15, "order": 1, "ext_number": 1, "ext_list": [ 90 ] } ], "ext_list": [ 58, 64, 90 ] } ], "ext_list": [ 75, 76, 39, 77, 62, 63, 65, 66, 38, 41, 57, 59, 60, 61, 58, 64, 90 ] } ] }