Restore Folder

Restore Folder

To restore a folder that has been moved to the trash, but has not yet been purged, make a POST request to the /folders/:folder_id endpoint. This will place the folder in the original parent folder if it is still available, or you optionally can specify a parent folder.

cURL
curl -i -X GET "https://api.box.com/2.0/folders/4353455" \
     -H "Authorization: Bearer <ACCESS_TOKEN>"
Java
String folderID = "125367";
String newName = "My Documents ORIGINAL";
String newParentID = "98765";

BoxTrash trash = new BoxTrash(api);
// Avoid conflicts at the original location
trash.restoreFolder(folderID, newName, newParentID);
Python
folder_to_restore = client.folder(folder_id='22222')
restored_folder = client.trash().restore_item(folder_to_restore)
print('Folder ID is {0} and name is {1}'.format(restored_folder.id, restored_folder.name))

During a folder restoration operation, part of the file tree will be locked, such as the source folder for the request and all of its descendants, as well as the destination folder.

During the restoration of the folder, no other move, copy, delete, or restore operation can be performed on the locked folders.