Skip to content

获取文件路径

适用版本>=v7.0.2407a.20240711

接口说明:获取文件路径

请求说明

请求地址配置域名+/graph+/v7/drives/{drive_id}/files/{file_id}/path
请求方法GET
签名方式WPS-4签名/WPS-4-GM签名(配置域名+/graph不参与签名)
权限要求更新文件(用户授权) kso.file.write 应用查询文件(应用授权) kso.appdrive.file.read

请求头(Header)

名称是否必填说明
Content-Type固定为: application/json
Wps-Docs-Date取当前时间, 示例: Wed, 23 Jan 2013 06:43:08 GMT
Wps-Docs-Authorization计算方法参考签名说明
Authorization授权凭证,格式为: Bearer {access_token}

路径参数(Path)

名称参数类型是否必填说明
drive_idstring驱动盘id,<= 1024 characters
file_idstring文件(夹)id,<= 1024 characters

响应体(Response)

名称类型说明
dataobject
location_idstring文件位置标识 当location_type为user或roaming时,对应的location_id为user_id; 当location_type为group、link时,对应的location_id分别为group_id、空串
location_typestring文件位置类型 link:共享,user:我的云文档,group:团队文档, roaming:我的设备
pathsobject[]文件路径
file_idstring文件id
namestring文件名称
codeinteger错误码,参照《错误码说明》
msgstring状态信息
detailstring详细信息

响应体示例

{
  "data": {
    "location_id": "string",
    "location_type": "link",
    "paths": [
      {
        "file_id": "string",
        "name": "string"
      }
    ]
  },
  "code": 0,
  "detail": "string",
  "msg": "string"
}