Use the download
method to download the contents of a directory as a compressed ZIP archive.
try {
const directoryId = 'directory_id_here' // The ID of the directory to be zipped and downloaded.
const zipFileName = 'downloaded_directory' // The name of the downloaded ZIP file.
const result = await sdk.directory.download(
directoryId,
zipFileName
)
if (result.success) {
console.log(`Downloaded ZIP file: ${zipFileName}.zip`)
} else {
console.error('Failed to download the directory as a ZIP file.')
}
} catch (error) {
console.error(error.message)
}
Params
directoryId
- The ID of the directory to be zipped and downloaded.zipFileName
- The name of the downloaded ZIP file (excluding the ".zip" extension).
Required API Key Permission
Read Directory