All Products
Search
Document Center

Drive and Photo Service:RestoreFile

Last Updated:Aug 04, 2025

Restores a file or folder from the recycle bin.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /v2/recyclebin/restore HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

The request parameters.

drive_idstringYes

The drive ID.

1
file_idstringYes

The ID of the file or folder.

4221bf6e6ab43a255edc4463bffa6f5f5d317401

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

domain_idstring

The domain ID.

bj1
drive_idstring

The drive ID.

1
file_idstring

The ID of the file or folder.

4221bf6e6ab43a255edc4463bffa6f5f5d317401
async_task_idstring

The ID of the asynchronous task.

If an empty string is returned, the file or folder is restored.

If a non-empty string is returned, an asynchronous task is required. You can call the GetAsyncTask operation to obtain the information about an asynchronous task based on the task ID.

4221bf6e6ab43c255edc4463bf3a6f5f5d317406

Examples

Sample success responses

JSONformat

{
  "domain_id": "bj1",
  "drive_id": 1,
  "file_id": "4221bf6e6ab43a255edc4463bffa6f5f5d317401",
  "async_task_id": "4221bf6e6ab43c255edc4463bf3a6f5f5d317406"
}

Error codes

For a list of error codes, visit the Service error codes.