I know this is a really dumb question but I cannot find a clear answer: what is a file_id? If I get a shared link for one of my files I see this:
https://---.box.com/s/w6623rvaz36xucb0jlmukio5zyk6se97
Is w6623rvaz36xucb0jlmukio5zyk6se97 the file_id? Or is it found somewhere else? The file properties does not show a file_id field. If I use the string above to download in a file in box-node-sdk I get a "not_found" error.
Postman:
localhost:5000/boxapi/file/w6623rvaz36xucb0jlmukio5zyk6se97/
Node Server boxapi.js:
router.get('/file/:id', (req, res) => {
console.log(`Box API get file with ID ${req.params.id}`);
boxClient.files.getReadStream(req.params.id, null, function(error, stream) {
if (error) {
console.log(`Box API error in downloading file with ID ${req.params.id}`);
return res.status(400).json({ error: error });
var output = fs.createWriteStream('/public/images/test.png');
stream.pipe(output);
console.log('Box API wrote file test.png to disk');
"statusCode": 404,
"body": {
"type": "error",
"status": 404,
"code": "not_found",
"help_url": "http://developers.box.com/docs/#errors",
"message": "Not Found",
"request_id": "w7aivvg0fg1n54or"
},