Skip to content

文件内容操作

适用版本>=v7.0.2512.20251225

接口说明:文件内容操作

请求说明

请求地址配置域名+/openapi+/v7/appfiles/drives/{drive_id}/files/{file_id}/content/operate
请求方法POST
签名方式KSO-1(配置域名+/openapi不参与签名)
权限要求应用身份管理文档(应用授权) kso.appfiles.cps.readwrite

请求头(Header)

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

路径参数(Path)

名称类型是否必填说明
drive_idstring驱动盘id
file_idstring文件id

查询参数(Query)

名称类型是否必填说明
_w_third_user_idstring操作者id

请求体(Body)

字段名类型必填说明
dst_drive_idstring目标驱动盘 ID
dst_parent_idstring目标父目录 ID
steps[]object操作步骤列表,每个步骤包含具体操作信息
operatestring操作类型,可选值:OFFICE_CLEAN - 清稿
argsobject操作参数,可选
∟∟ clean_options[]string清稿可选项:
accept_all_revisions - 指定接受所有修订
delete_all_comments - 删除所有批注
delete_all_ink - 删除所有墨迹
默认所有参数都会生效:accept_all_revisions,delete_all_comments,delete_all_ink

请求体示例

json
{
  "dst_drive_id": "1234567890",
  "dst_parent_id": "0",
  "steps": [
    {
      "operate": "OFFICE_CLEAN",
      "args": {
        "clean_options": [
          "accept_all_revisions"
        ]
      }
    }
  ]
}

响应体(Response)

名称类型说明
dataobject返回的数据对象
∟ idstring文件 ID
∟ namestring文件名称
∟ typestring文件类型,Enum: "folder" "file"
∟ parent_idstring父目录 ID(例如 "0"
∟ sizeinteger文件大小(字节)
∟ versioninteger文件版本号
∟ drive_idstring驱动盘 ID
∟ ctimeinteger创建时间
∟ mtimeinteger修改时间
∟ sharedboolean是否开启分享(应用文档为 false
∟ link_idstring链接 ID(应用文档为空字符串)
∟ link_urlstring链接 URL(应用文档为空字符串)
∟ created_byobject创建者信息
∟∟ idstring身份 ID
∟∟ typestringEnum: "user" "sp"
∟ modified_byobject修改者信息
∟∟ idstring身份 ID
∟∟ typestringEnum: "user" "sp"
codeint错误码
msgstring状态信息
detailstring详细信息

响应体示例

json
{
    "data": {
        "id": "350747753447424",
        "drive_id": "349087249465344",
        "parent_id": "0",
        "created_by": {
            "id": "userId",
            "type": "sp"
        },
        "modified_by": {
            "id": "userId",
            "type": "sp"
        },
        "size": 11055,
        "version": 1,
        "type": "file",
        "name": "应用文档测试文件.docx",
        "ctime": 1764929562,
        "mtime": 1764929562,
        "shared": false,
        "link_url": "",
        "link_id": ""
    },
    "code": 0,
    "detail": "",
    "msg": "ok"
}