Skip to content

搜索部门

适用版本>=v7.0.2412b.20241226

接口说明:搜索部门

请求说明

请求地址配置域名+/openapi+/v7/depts/search
请求方法GET
签名方式KSO-1(配置域名+/openapi不参与签名)
权限要求查询和管理通讯录信息(用户授权)kso.contact.readwrite
查询通讯录信息(用户授权)kso.contact.read

请求头(Header)

Header参数类型是否必填说明
X-Kso-DatestringRFC1123 格式的日期,例: Wed, 23 Jan 2013 06:43:08 GMT
X-Kso-AuthorizationstringKSO-1 签名值,详见《签名方法》
Authorizationstring授权凭证,格式为:Bearer {access_token}

查询参数(Query)

名称参数类型是否必填说明
keywordstring搜索关键字
page_sizeint64分页大小,最小值:1,最大值:50
page_tokenstring分页标记,第一次请求不填,表示从头开始遍历;分页查询结果还有更多项时会同时返回next_page_token作为新的page_token,下次遍历可采用该page_token获取查询结果;当查询结果中next_page_token为空或无该返回值时,代表无下一页。
search_sourcestring[]搜索范围,可选值: company_dept:本企业部门; enterprise_partner:关联组织部门;
格式为search_source={string_1}&search_source={string_2}

响应体(Response)

名称类型说明
codeint错误码
detailstring详细信息
msgstring状态信息
dataobject返回信息体
itemsobject[]部门信息
abs_pathstring绝对路径
ctimeinteger创建时间,时间戳,单位为秒
ex_dept_idstring部门外部id,可以是外部身份源的ID,为空则默认为部门id
high_lightobject高亮信息
idstring部门id,自动生成
leadersobjects[]部门领导id
orderint64排序值
user_idstring部门领导user_id
namestring部门名称
orderinteger排序值
parent_idstring父部门id
next_page_token string下一页token;当查询结果中next_page_token为空或无该返回值时,代表无下一页

响应体示例

json
{
  "data": {
    "items": [
      {
        "high_light": {
          "string": ["string"]
        },
        "abs_path": "string",
        "ctime": 0,
        "ex_dept_id": "string",
        "id": "string",
        "leaders": [
          {
            "order": 0,
            "user_id": "string"
          }
        ],
        "name": "string",
        "order": 0,
        "parent_id": "string"
      }
    ],
    "next_page_token": "string"
  },
  "code": 0,
  "detail": "string",
  "msg": "string"
}