Skip to content

文件搜索

标签搜索文件

请求说明

字段
请求地址
https://openapi.wps.cn/v7/files/search
HTTP 方法
GET
接口描述
文件搜索
签名方式
KSO-1
限频策略
权限要求
搜索文件(应用授权) kso.file.search
搜索文件(用户授权) kso.file_search.readwrite
搜索文件(用户授权) kso.file.search

请求头 (Headers)

属性名类型是否必填描述可选值
X-Kso-Id-Type
string类型
* internal - 内部
* external - 外部
internal, external

查询参数 (Query)

属性名类型是否必填描述可选值
keyword
string搜索关键字-
type
string搜索类型file_name, content, all
file_type
string文件类型,不传默认全搜folder, file, shortcut
file_exts
array文件后缀-
drive_ids
array搜索盘列表,v7接口支持数组,但是还没有应用场景-
parent_ids
array搜索目录列表-
creator_ids
array创建者id,公网只支持选择是否自己创建的文件-
modifier_ids
array编辑者id-
sharer_ids
array分享者id-
receiver_ids
array接收者id-
time_type
string时间范围ctime, mtime, otime, stime
start_time
integer最小时间-
end_time
integer最大时间-
with_permission
boolean是否返回文件操作权限-
with_link
boolean是否返回文件分享信息-
with_total
boolean是否返回搜索到的总条数-
page_size
integer分页大小,公网限制最大为500-
page_token
string翻页token-
channels
array渠道信息-
device_ids
array设备id-
exclude_channels
array排除渠道信息-
exclude_file_exts
array排除文件后缀-
filter_user_id
integer创建者分享者过滤-
file_ext_groups
array文件分组后缀-
with_folder
boolean是否返回文件夹文件, 已过期, 使用file_type字段实现-
with_drive
boolean是否返回驱动盘-
order
string排序方式desc, asc
order_by
string排序字段ctime, mtime
scope
array搜索范围all, share_by_me, share_to_me, latest, personal_drive, group_drive, recycle, customize, latest_opened, latest_edited
search_operator_name
boolean搜索文件的创建者或文件分享者-

响应体(Response)

HTTP状态码: 200
响应体格式: application/json

没有可用的数据

响应体示例

json
{
  "data": {
    "items": [
      {
        "file": {
          "created_by": {
            "avatar": "string",
            "company_id": "string",
            "id": "string",
            "name": "string",
            "type": "user"
          },
          "ctime": 0,
          "drive": {
            "allotee_id": "string",
            "allotee_type": "user",
            "company_id": "string",
            "created_by": {
              "avatar": "string",
              "company_id": "string",
              "id": "string",
              "name": "string",
              "type": "user"
            },
            "ctime": 0,
            "description": "string",
            "ext_attrs": [
              {
                "name": "string",
                "value": "string"
              }
            ],
            "id": "string",
            "mtime": 0,
            "name": "string",
            "quota": {
              "deleted": 0,
              "remaining": 0,
              "total": 0,
              "used": 0
            },
            "source": "string",
            "status": "inuse"
          },
          "drive_id": "string",
          "ext_attrs": [
            {
              "name": "string",
              "value": "string"
            }
          ],
          "id": "string",
          "link_id": "string",
          "link_url": "string",
          "modified_by": {
            "avatar": "string",
            "company_id": "string",
            "id": "string",
            "name": "string",
            "type": "user"
          },
          "mtime": 0,
          "name": "string",
          "parent_id": "string",
          "permission": {
            "comment": true,
            "copy": true,
            "copy_content": true,
            "delete": true,
            "download": true,
            "history": true,
            "list": true,
            "move": true,
            "new_empty": true,
            "perm_ctl": true,
            "preview": true,
            "print": true,
            "rename": true,
            "saveas": true,
            "secret": true,
            "share": true,
            "update": true,
            "upload": true
          },
          "shared": true,
          "size": 0,
          "type": "folder",
          "version": 0
        },
        "file_src": {
          "name": "string",
          "path": "string",
          "type": "link"
        },
        "highlights": {
          "example_key": [
            "string"
          ]
        },
        "otime": 0
      }
    ],
    "next_page_token": "string",
    "total": 0
  },
  "code": 0,
  "msg": "string"
}