Skip to main content

Restore file from Trash

A request to move file to Trash folder.

POST /api/v1/files/{fileId}/untrash HTTP/1.1
note

[Since 2016.4] Generates Notification file restore from trash

note

[Prior to 2016.4] Generates Notification add file/folder for destination folderId and Notification file delete for Trash folderId.

  1. Path parameters
ParameterDescription
fileIdThe ID of the file
  1. Response structure

See Get file info.

  1. Example request
curl 'http://localhost:8080/api/v1/files/a2fe08b9-bfda-4d9c-ae96-44a3a7f0f09e/untrash' -i -X POST \
-H 'X-co-auth-token: ec2851c9ae31daf6872d1c7bbff9fbe2'
  1. Example response
HTTP/1.1 200 OK
X-co-request-id: 777535575453764f363950656b6a7456
Content-Type: application/vnd.ncloudtech.cloudoffice.file+json;v=1;charset=UTF-8
Content-Length: 2277
{
"file": {
"id": "a2fe08b9-bfda-4d9c-ae96-44a3a7f0f09e",
"createdDate": "2022-04-06T15:58:04.000Z",
"creator": "testsrvdocs@tacos.devoffice.ru",
"creatorFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"creatorFirstName": "r",
"creatorLastName": "t",
"creatorMiddleName": "f",
"fileSize": "20",
"filename": "testfile.txt",
"headRevisionId": "189365082",
"lastModifyingUserId": "testsrvdocs@tacos.devoffice.ru",
"lastModifyingUserFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"lastModifyingUserFirstName": "r",
"lastModifyingUserLastName": "t",
"lastModifyingUserMiddleName": "f",
"mediaType": "text/plain",
"modifiedByMeDate": "2022-04-06T15:58:04.000Z",
"modifiedDate": "2022-04-06T15:58:04.000Z",
"ownerFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"ownerId": "testsrvdocs@tacos.devoffice.ru",
"parentId": "189365016",
"preview": "189365299",
"previewClientVersion": "3.2",
"properties": [],
"totalSize": "20",
"checksum": "e0e102b9ff40785fac8902d8bcbf2279",
"tree": "/docs-test-untrashFileExample()-gj14XPiK4q/testfile.txt",
"ownerFirstName": "r",
"ownerLastName": "t",
"ownerMiddleName": "f",
"isVersion": false,
"originalFileIdOpt": null,
"creatorIsDeleted": false,
"editorIsDeleted": false,
"ownerIsDeleted": false,
"ownerAvatar": "a00bbb30-993e-4632-925f-152939195049",
"creatorAvatar": "a00bbb30-993e-4632-925f-152939195049",
"editorAvatar": "a00bbb30-993e-4632-925f-152939195049"
},
"links": [
{
"rel": "self",
"href": "http://localhost:8080/api/v1/files/189365081"
},
{
"rel": "download",
"href": "http://localhost:8080/api/v1/files/189365081/content"
},
{
"rel": "import",
"href": "http://localhost:8080/api/v1/files/189365081/import"
},
{
"rel": "preview",
"href": "http://localhost:8080/api/v1/files/189365081/preview"
},
{
"rel": "link",
"href": "http://localhost:8080/link/189365081"
}
]
}