I created a client using the Box NodeJS SDK.
var client = sdk.getAppAuthClient('enterprise');
It is successful in retrieving the user info. But when I try to get info about a file. Using the following methods
client.folders.get('xxx-xxx-xxx')
.then(file => {
console.log(file)
})
.catch(e => {
console.log(e)
})
I get a 404 error. I am not sure what the problem. My box app is not able to have access to my box account files
You need to add the automationUser (your app) as a collaborator to the folder.
You can get the automationUser email in node like this
var client = await sdk.getAppAuthClient('enterprise', ENTERPRISE_ID);
var automationUser = await adminClient.users.get(client.CURRENT_USER_ID)
console.log(automationUser.login)