Skip to main content

Restore revision

note

[Since 2017.02]

A request to restore file’s revision. Specified revision will be copied to a new revision. It’s impossible to restore a revision of a file opened for collaboration.

POST /api/v1/files/{fileId}/revisions/{revId}/restore
  1. Path parameters
ParameterDescription
fileIdId of a file
revIdId of a revision
  1. Response structure
PathTypeDescription
revisionObjectRevision object
links[]ArrayCommon hypermedia links
revision.checksumStringAn MD5 checksum for the content of the revision
revision.createdDateStringCreation date of the revision
revision.fileSizeStringSize of the revision in bytes
revision.idStringId of the revision
revision.isLastRevisionBooleanCurrent revision flag
revision.mediaTypeStringMedia type of the revision
revision.modifiedDateStringModification date of the revision
revision.titleStringTitle for the revision
revision.ownerIdStringThe file owner id
revision.ownerLoginStringLogin of file’s owner
revision.ownerEmailStringEmail of file’s owner
revision.ownerFirstNameStringFirst name of file’s owner
revision.ownerLastNameStringLast name of file’s owner
revision.ownerMiddleNameStringMiddle name of file’s owner
revision.creatorIdStringRevision creator id
revision.creatorLoginStringLogin of revision’s creator
revision.creatorEmailStringEmail of revision’s creator
revision.creatorFirstNameStringFirst name of revision’s creator
revision.creatorMiddleNameStringMiddle name of revision’s creator
revision.creatorLastNameStringLast name of revision’s creator
revision.pinnedBooleanMark to not auto delete revision
revision.creatorIsDeletedBooleanMark creator is deleted
revision.ownerIsDeletedBooleanMark owner is deleted
revision.ownerAvatarStringOwner avatar
revision.creatorAvatarStringCreator avatar
links[].relStringLink type
links[].hrefStringLink reference
  1. Example request
curl 'http://localhost:8080/api/v1/files/189402868/revisions/189403176/restore?title=SampleTitle' -i -X POST \
-H 'X-co-auth-token: 1458fab4ac8b58fdf542e89aa8433c28' \
-H 'Content-Type: application/x-www-form-urlencoded'
  1. Example response
HTTP/1.1 200 OK
X-co-request-id: 49787357424349315548723656563678
Content-Type: application/json
Content-Length: 1208
{
"revision": {
"id": "189403499",
"fileSize": "20",
"creatorId": "5177189d266a4862ad93b1cda2f5ac2b",
"creatorFirstName": "a",
"creatorLastName": "s",
"creatorMiddleName": "d",
"creatorLogin": "testsrvdocs@srv-one.tacos.devoffice.ru",
"creatorEmail": "testsrvdocs@srv-one.tacos.devoffice.ru",
"isLastRevision": true,
"mediaType": "text/plain",
"ownerId": "5177189d266a4862ad93b1cda2f5ac2b",
"ownerFirstName": "a",
"ownerLastName": "s",
"ownerMiddleName": "d",
"ownerLogin": "testsrvdocs@srv-one.tacos.devoffice.ru",
"ownerEmail": "testsrvdocs@srv-one.tacos.devoffice.ru",
"title": "SampleTitle",
"createdDate": "2022-04-06T16:01:14.000Z",
"modifiedDate": "2022-04-06T16:01:14.000Z",
"checksum": "e0e102b9ff40785fac8902d8bcbf2279",
"pinned": false,
"creatorIsDeleted": false,
"ownerIsDeleted": false,
"ownerAvatar": "a00bbb30-993e-4632-925f-152939195049",
"creatorAvatar": "a00bbb30-993e-4632-925f-152939195049"
},
"links": [
{
"rel": "self",
"href": "http://localhost:8080/api/v1/files/189403499"
}
]
}