Use the getTotalSize
method to retrieve the total size of a directory.
try {
const directoryId = 'directory_id_here' // The ID of the directory to get the size of.
const size = await sdk.directory.getTotalSize(directoryId)
console.log(`Total size of directory: ${size} bytes`)
} catch (error) {
console.error(error.message)
}
Params
directoryId
(string): The ID of the directory for which you want to retrieve the size.
Required API Key Permission
Read Directory