Restore file
Restore a file from the deleted state. Minor version will be incremented for restore operation.
The file will be restored to the original location if the request body is empty. If there is already active file in original location, deleted file can be restored to different location by specifying targetParentId. To restore the file in same location during conflict, specify different name for the resource through name attribute.
Prerequisites
Section titled “Prerequisites”- A file should be in soft deleted state. To know more about deleting a file refer here
- Target parent folder should be created in case of conflict. To know more about creating a folder refer here
Request
Section titled “Request”POST {baseUrl}/spaces/{spaceId}/files/{fileId}/restoreRestore file will be synchronously restored to the location.
-
HEADER:
- Authorization:
Bearer {tid token}
- Authorization:
Response
Section titled “Response”Restore File in different location
Section titled “Restore File in different location”In case of conflict if user wants to restore the deleted file in different location with different name, user can provide those details.
Request
Section titled “Request”POST {baseUrl}/spaces/{spaceId}/files/{fileId}/restore-
HEADER:
- Authorization:
Bearer {tid token}
- Authorization:
-
BODY:
name- name of file to be restoredtargetParentId- target where the source file need to be restored
{ "name": "new_name", "targetParentId": "6529d0b3-5856-41ab-88b3-86f7955cddf1"}Response
Section titled “Response”To know more about the restore file API refer here.