Last update:2025-08-18 15:32:25
This API can restore files stored in Archive Storage type. Once restored, you can directly access these archived files.
To call this API, send a POST request in the following format:
POST /restore/{encodedEntry}/days/{duration}
Host: {mgrDomain}
Authorization: {managementcredential}
The following table provides the necessary information and description of the parameters:
| Parameter | Required | Description |
|---|---|---|
encodedEntry |
Yes | The file to be restored, formatted as EncodeEntryURI(bucket:key), where bucket is the storage bucket name and key is the file name (including path). For example, YnVja2V0MToxLmpwZw== represents the URL-safe Base64 encoded form of bucket1:1.jpg. |
days |
Yes | The duration for which the file will be accessible after restoration, with a minimum of 1 day. If the format is invalid, a 400 error will be returned. |
mgrDomain |
Yes | The management domain, which can be found in the Overview section of the bucket. The format is usually *.v1.wcsapi.com. |
managementcredential |
Yes | The management credential is used for authentication in API calls. For more details on creating the management credential, please refer to Management Credential. |
The following example shows how to initiate a request to restore an archived file using the curl command:
curl -v -X POST "http://{mgrDomain}/restore/aW1hZ2VzOkltYWdlLnBuZw==/days/1"
On successful call:
{"code": 200, "message": "ok"}
{"code": 401, "message": "Invalid Object State"}
{"code": 409, "message": "Restore Is InProgress"}
{"code": 403, "message": "Unsupported Operation"}
{"code": 404, "message": "File Not Found"}
{
"code": "<httpCode int>",
"message": "<errMsg string>"
}
| Field name | Required | Description |
|---|---|---|
| code | Yes | For HTTP request response codes, see HTTP Response Status Codes . |
| message | Yes | Request prompt information. OK means success. |