Move Folder
Move Folder
To move a folder, update the ID of its parent folder.
cURL
curl -X PUT https://api.box.com/2.0/folders/4353455 \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
-H 'Content-Type: application/json" '
-d '{
"name": "New folder name",
"parent": {
"id": "123"
}
}'
Node
var folderID = '11111';
var destinationFolderID = '22222';
client.folders.move(folderID, destinationfolderID)
.then(folder => {
/* folder -> {
type: 'folder',
id: '11111',
sequence_id: '1',
etag: '1',
name: 'Pictures from 2017',
created_at: '2012-12-12T10:53:43-08:00',
modified_at: '2012-12-12T11:15:04-08:00',
description: 'Some pictures I took',
size: 629644,
path_collection:
{ total_count: 1,
entries:
[ { type: 'folder',
id: '0',
sequence_id: null,
etag: null,
name: 'All Files' },
{ type: 'folder',
id: '22222',
sequence_id: '3',
etag: '3',
name: 'Archives' } ] },
created_by:
{ type: 'user',
id: '22222',
name: 'Example User'
login: 'user@example.com' },
modified_by:
{ type: 'user',
id: '22222',
name: 'Example User',
login: 'user@example.com' },
owned_by:
{ type: 'user',
id: '22222',
name: 'Example User',
login: 'user@example.com' },
shared_link: null,
parent:
{ type: 'folder',
id: '22222',
sequence_id: '3',
etag: '3',
name: 'Archives' },
item_status: 'active',
item_collection:
{ total_count: 1,
entries:
[ { type: 'file',
id: '33333',
sequence_id: '3',
etag: '3',
sha1: '134b65991ed521fcfe4724b7d814ab8ded5185dc',
name: 'tigers.jpeg' } ],
offset: 0,
limit: 100 } }
*/
});