Unable to download file from Box using box-java-sdk getting Exception
AnsweredBoxFile file = new BoxFile(api, "id"); BoxFile.Info info = file.getInfo(); FileOutputStream stream = new FileOutputStream(info.getName()); file.download(stream); stream.close();
This is the code.
when I am trying to download I am getting exception
com.box.sdk.BoxAPIResponseException: The API returned an error code [404] 404.7010.0001 - The requested resource was not found
-
Hello,
This error indicates that the user associated with your token does not have access (by ownership or collaboration) to the file you're trying to download. You will need to add this user as a collaborator or obtain a token for a user that already has access.
You can find out the user associated with your current token by using this endpoint: https://developer.box.com/reference/get-users-me/.
Best,
Kourtney
Box Technical Support Engineer
-
HI Kourtney I am also getting the same error. I am using my credentials to download the file and I can see that I've editor access to this file. Could you please help me how to resolve this issue.
Please sign in to leave a comment.
Comments
2 comments