产品概述
功能介绍
产品优势
应用场景
基本概念
PUT /api/v1/file/{LibraryId}/{SpaceId}/{FilePath}?convert&conflict_resolution_strategy={ConflictResolutionStrategy}&access_token={AccessToken}&user_id={UserId}
请求参数 | 描述 | 类型 | 是否必选 |
LibraryId | String | 是 | |
SpaceId | String | 是 | |
FilePath | 指定文档转码后保存的完整文件路径,例如 foo/bar/file_new.pdf,要保证 foo/bar 目录存在 | String | 否 |
ConflictResolutionStrategy | 文件名冲突时的处理方式,默认为 rename: ask:冲突时返回 HTTP 409 Conflict 及 SameNameDirectoryOrFileExists 错误码 rename:冲突时自动重命名文件 overwrite: 如果目标为目录或相簿时,默认为 ask 且不支持 overwrite。 如果目标为文件,覆盖已有文件。 当目标空间的文件存在历史版本时,不支持移动覆盖 | String | 否 |
AccessToken | String | 是 | |
UserId | String | 否 |
{"convertFrom": "a/b/xxx.docx"}
请求参数 | 描述 | 类型 | 是否必选 |
convertFrom | 指定文档转码要操作的源文件 | String | 是 |
{ "taskId": 23 }
[{"taskId": 23,"status": 200,"result": {"convertFrom": [ "a", "b", "xxx.docx" ],"path": [ "foo", "bar", "file_new (2).pdf" ],"srcInode": "a04db459dea9042e0006412d47189f3f","dstInode": "737c04ae9a20dca00006412e97bc5b8c"}}]
响应参数 | 描述 | 类型 |
taskId | 异步方式恢复时的任务 ID,可通过查询任务接口查询任务状态 | Int |
status | 202: 任务进行中,200: 任务执行成功 | Int |
result | 转码操作结果 | Array |
响应参数 | 描述 | 类型 |
convertFrom | 表示转码操作的源文件的路径 | String Array |
path | 表示转码后保存的最终的文件路径 | String Array |
srcInode | 表示要转码的源文件的 inode | String |
dstInode | 表示转码后保存的最终的文件的 inode | String |
文档反馈