Restores a deleted file back to its page
Name | Type | Description |
fileid | int | identifies a file by ID |
Name | Type | Description |
to | string? | Optional restore-to page to override a removed file's original parent id |
authenticate | bool? | Force authentication for request (default: false) |
Name | Value | Description |
OK | 200 | The request completed successfully |
Bad Request | 400 | Invalid input parameter or request body |
Forbidden | 403 | Administrator access is required |
Not Found | 404 | Requested file could not be found in the archive |
Use GET:archive/files to retrieve a list of files currently in the archive.
When a file is restored, it is moved from the file archive to the destination page. If the caller does not specify a destination page, the file is restored to its original page. A placeholder page will be created if the original page no longer exists.
The following code example restores file with ID 456 to the home page:
Plug p = Plug.New("http://deki-hayes/@api/deki"); p.At("users", "authenticate").WithCredentials("admin", "password").Get(); p.At("archive", "files", "restore", "456").With("to", "home").Post();
This following command restores file with archive.fileID = 1 to its original page.
curl -u admin:password -H "Content-Type: text/plain" -d "" -i http://mindtouch.address/@api/deki/archive/files/restore/1
File with file.archive ID = 66 was accidently deleted and needs to be restored. The following command accomplishes that:
curl -u admin:password -H "Content-Type: text/plain" -d "" -i http://192.168.59.128/@api/deki/archive/files/restore/66
HTTP/1.1 200 OK Date: Tue, 19 Jan 2010 01:28:47 GMT Server: Dream-HTTPAPI/2.0.0.17629 Microsoft-HTTPAPI/2.0 Content-Length: 0 X-Data-Stats: request-time-ms=247; mysql-queries=15; mysql-time-ms=85; X-Deki-Site: id="default" Via: 1.1 dekiwiki Content-Type: text/plain