搜索特定部门

在部门列表中搜索特定部门。

请求 URL

GET {base_url}/{api_path}/organization/search?access_token={access_token}

请求参数

1.
参数 是否必填 类型 说明
page Integer 定义显示第几个页面。
page_size Integer 定义每页显示几项查询结果。
sort_by String 定义排序字段。

取值范围id

order_by String 定义显示顺序。

取值范围

  • asc:升序
  • desc:降序
is_all Integer 是否返回完整信息。

取值范围

  • 0:返回包含分机统计数据的部门信息。
  • 1:返回包含分机统计数据和分机列表的部门信息。
  • 2:仅返回部门信息。
search_value String 搜索关键字。

响应参数

2.
参数 类型 说明
errcode Integer 返回错误码。
  • 0:请求成功。
  • 非零值:请求失败。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息
errmsg String 返回信息。
  • SUCCESS:请求成功。
  • FAILURE:请求失败。
organization_list Array<Organization_List> 部门信息。
Organization_List
3.
参数 类型 说明
id Integer 部门的唯一 ID。
name String 部门名称。
parent_id String 父部门的唯一 ID。
order String 部门序号。
ext_number String 部门中包含的分机总数。
注: 此参数仅在 is_all 参数值为 01 时返回。
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 参数值为 01 时返回。
children Array<Sub_Organization> 子部门信息。
ext_list Array<Integer> 部门中包含的分机列表。
注: 此参数仅在 is_all 参数值为 1 时返回。

示例

请求示例

GET /openapi/v1.0/organization/search?access_token=Q7p2OrTnB3hZkdn4i19gG8T2yHEnq2kZ&is_all=1 HTTP/1.1  
Host: 192.168.5.150:8088

响应示例

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "organization_list": [
        {
            "id": 1,
            "name": "Yeastar",
            "parent_id": 0,
            "order": 1,
            "ext_number": 21,
            "children": [
                {
                    "id": 2,
                    "name": "Tech support",
                    "parent_id": 1,
                    "order": 1,
                    "ext_number": 6,
                    "children": [
                        {
                            "id": 4,
                            "name": "666",
                            "parent_id": 2,
                            "order": 1,
                            "ext_number": 2,
                            "ext_list": [
                                66,
                                62
                            ]
                        },
                        {
                            "id": 10,
                            "name": "tst",
                            "parent_id": 2,
                            "order": 2,
                            "ext_number": 1,
                            "ext_list": [
                                39
                            ]
                        }
                    ],
                    "ext_list": [
                        77,
                        75,
                        76,
                        39,
                        66,
                        62
                    ]
                },
                {
                    "id": 3,
                    "name": "Sales",
                    "parent_id": 1,
                    "order": 2,
                    "ext_number": 1,
                    "ext_list": [
                        76
                    ]
                },
                {
                    "id": 6,
                    "name": "123",
                    "parent_id": 1,
                    "order": 3
                },
                {
                    "id": 7,
                    "name": "1pp3",
                    "parent_id": 1,
                    "order": 4
                },
                {
                    "id": 8,
                    "name": "1p99",
                    "parent_id": 1,
                    "order": 5
                }
            ],
            "ext_list": [
                38,
                41,
                57,
                59,
                60,
                61,
                58,
                63,
                64,
                65,
                77,
                75,
                76,
                39,
                66,
                62,
                89,
                90,
                91,
                92,
                93
            ]
        }
    ]
}