Downloads module is used to download files from Box.
To get the entire contents of the file as ArrayBuffer, call downloadFile method.
This method returns a ArrayBuffer object which contains the file content.
const fs = require('fs');
const fileContent = await client.downloads.downloadFile('123456789');
const fileWriteStream = fs.createWriteStream('file.pdf');
fileContent.pipe(fileWriteStream);
Get a URL to download a file
This operation is performed by calling function getDownloadFileUrl.
await client.downloads.getDownloadFileUrl(uploadedFile.id);
string
https://*.app.box.com/files/123 the file_id is 123. Example: “12345”GetDownloadFileUrlOptionalsInputThis function returns a value of type string.