Product Overview
Feature Description
Product Strengths
Use Cases
Basic Concept
PUT /api/v1/file/{LibraryId}/{SpaceId}/{FilePath}?convert&conflict_resolution_strategy={ConflictResolutionStrategy}&access_token={AccessToken}&user_id={UserId}
Request parameters. | Description | Type | Required or Not |
LibraryId | Media Library ID, obtained after creating a media library in the media hosting console, see Create Media Library | String | Yes |
SpaceId | Space ID. If the media library is in single-tenant mode, this parameter is fixed as a hyphen (`-`). If the media library is in multi-tenant mode, you must specify this parameter. See Create Tenant Space | String | No |
FilePath | Specify the complete file path to save the transcoded document, such as foo/bar/file_new.pdf, and ensure the foo/bar directory exists. | String | No |
ConflictResolutionStrategy | Handling method for filename conflict, default is rename. ask: returns HTTP 409 Conflict and the SameNameDirectoryOrFileExists error code when conflicts with rename: automatically rename file when conflicts with overwrite: If the target is a directory or album, it defaults to ask and does not support overwrite. If the target is a file, overwrite the existing file. When a file with an earlier version exists in the target space, do not support moving and overwriting. | String | No |
AccessToken | Access token, see Generate Access Token | String | Yes |
UserId | User identity recognition. When the permission corresponding to the access token is admin permission and user identity recognition during token application is empty, it is used to temporarily specify user identity. For details, see Generate Access Token API | String | No |
{"convertFrom": "a/b/xxx.docx"}
Request parameters. | Description | Type | Required or Not |
convertFrom | Specify the source file for document transcoding | String | Yes |
{ "taskId": 23 }
[{"taskId": 23,"status": 200,"result": {"convertFrom": [ "a", "b", "xxx.docx" ],"path": [ "foo", "bar", "file_new (2).pdf" ],"srcInode": "a04db459dea9042e0006412d47189f3f","dstInode": "737c04ae9a20dca00006412e97bc5b8c"}}]
Response Parameters | Description | Type |
taskId | The task ID when recovering asynchronously can be used to query task status via the Query Task API. | Int |
status | 202: Task in progress 200: Task executed successfully | Int |
result | Transcoding Operation Result | Array |
Response Parameters | Description | Type |
convertFrom | Source file path for transcoding | String Array |
path | Final file path after transcoding | String Array |
srcInode | File inode to transcode | String |
dstInode | File inode after transcoding | String |
フィードバック