Use the move
method to move directories and files to a specific drive.
try {
const driveId = 'target_drive_id_here'; // The ID of the target drive.
const directoryIds = ['directory_id_1', 'directory_id_2']; // An array of directory IDs to move.
const fileIds = ['file_id_1', 'file_id_2']; // (optional) An array of file IDs to move.
const moveResult = await sdk.drive.move(driveId, directoryIds, fileIds);
console.log('Contents moved to drive:', moveResult);
} catch (error) {
console.error(error.message);
}
Params
driveId
(string): The ID of the target drive.directoryIds
(string[]): An array of directory IDs to move.fileIds
(string[]): (optional) An array of file IDs to move.
Required API Key Permission
Create Directory
Delete Directory