ごみ箱に移動されたフォルダを復元します。
元のフォルダが削除されている場合にフォルダの復元先となる新しい親ID(省略可)を指定することができます。
この操作の進行中は、ファイルツリーの一部がロックされます。ロックされるのは主に元のフォルダとその子孫フォルダ、および宛先フォルダです。
操作の進行中は、ロックされたどのフォルダに対しても、その他の移動、コピー、削除または復元操作を実行できません。
0
フォルダを表す一意の識別子。
フォルダIDを確認するには、ウェブアプリケーションでこのフォルダにアクセスして、URLからIDをコピーします。たとえば、URLがhttps://*.app.box.com/folder/123
の場合、folder_id
は123
です。
Boxアカウントのルートフォルダは常にID 0
で表されます。
id,type,name
応答に含める属性のカンマ区切りリスト。このパラメータを使用すると、標準の応答には通常含まれないフィールドをリクエストできます。
このパラメータを指定すると、明示的に指定しない限り標準フィールドは応答に含まれず、リクエストしたフィールドのほかには、簡易版レプリゼンテーションのフィールドしか返されないことに注意してください。
Restored Photos
フォルダの新しい名前(省略可)。
元のフォルダがすでに存在しない場合にフォルダの復元先となるフォルダのID(省略可)を指定します。
このIDは、元のフォルダがすでに存在しない場合にのみ使用されることに注意してください。このIDは、元の場所が削除されている場合にフォルダの復元先となるフォールバックの場所を指定します。
123
親項目のID
フォルダが復元されたときにフォルダオブジェクトを返します。
フォルダの復元先フォルダに対してユーザーがアクセス権限を持っていない場合、またはごみ箱からフォルダを復元する権限を持っていない場合は、エラーを返します。
フォルダがごみ箱内にない場合は、エラーを返します。
operation_blocked_temporary
: 別の移動、コピー、削除
または復元操作が進行中であるために宛先フォルダまたは元のフォルダが
ロックされている場合に返されます。
操作は後で再試行することができます。
予期しないクライアントエラー。
curl -X GET https://api.box.com/2.0/folders/4353455 \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
var requestParams = new BoxFolderRequest()
{
Name = "Name in case of conflict",
Parent = new BoxRequestEntity()
{
// Folder will be placed in this parent folder if original location no longer exists
Id = "12345"
}
};
BoxFolder restoredFolder = await client.FoldersManager.RestoreTrashedFolderAsync(requestParams);
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);
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))
client.folders.restoreFromTrash(
'22222',
{
// New name in case of conflict
name: 'New Name',
// Folder will be placed in this parent folder if the original parent no longer exists
parent_id: '0'
})
.then(restoredFolder => {
/* trashedFolder -> {
type: 'folder',
id: '22222',
sequence_id: '1',
etag: '1',
name: 'Old Files',
created_at: '2013-05-06T22:37:30-07:00',
modified_at: '2013-05-06T22:39:08-07:00',
description: '',
size: 18482,
path_collection:
{ total_count: 1,
entries:
[ { type: 'folder',
id: '0',
sequence_id: null,
etag: null,
name: 'All Files' } ] },
created_by:
{ type: 'user',
id: '33333',
name: 'Example User',
login: 'user@example.com' },
modified_by:
{ type: 'user',
id: '33333',
name: 'Example User',
login: 'user@example.com' },
trashed_at: null,
purged_at: null,
content_created_at: '2013-05-06T22:37:30-07:00',
content_modified_at: '2013-05-06T22:39:08-07:00',
owned_by:
{ type: 'user',
id: '33333',
name: 'Example User',
login: 'user@example.com' },
shared_link: null,
folder_upload_email: null,
parent:
{ type: 'folder',
id: '0',
sequence_id: null,
etag: null,
name: 'All Files' },
item_status: 'active' }
*/
});