Error:"Invalid value 'd_xxxxxxxxxx2'" while using Box config file
AnsweredHi All
I am facing an issue only when using Box config file.
It is failing exactly on the line highlighted in below code snippet.
I am passing "xxxxxxxxxx2" as my parent folder Id. But in the exception message it seems to be appending "d_" before the parent folder Id.
Whereas, I can see no issue when using Developer Token for the same task.
Exception:
The API returned an error code: 404
{"type":"error","status":404,"code":"not_found","context_info":{"errors":[{"reason":"invalid_parameter","name":"folder","message":"Invalid value 'd_xxxxxxxxxx2'. 'folder' with value 'd_xxxxxxxxxx2' not found"}]},"help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Not Found","request_id":"ejhgfyugchbakus6"}
Code snippet:
Reader reader = new FileReader("src/main/resources/xxxxxxxx_xxxxx_config.json");
BoxConfig boxConfig = BoxConfig.readFrom(reader);
IAccessTokenCache accessTokenCache = new InMemoryLRUAccessTokenCache(100);
BoxDeveloperEditionAPIConnection bac = BoxDeveloperEditionAPIConnection.getAppEnterpriseConnection(boxConfig, accessTokenCache);
BoxFolder bfolder = new BoxFolder(bac, "xxxxxxxxxx2");
for (BoxItem.Info itemInfo : bfolder) {
if (itemInfo instanceof BoxFolder.Info) {
BoxFolder.Info folderInfo = (BoxFolder.Info) itemInfo;
if(folderInfo.getName().toString().compareTo("Folder1")==0)
{
info = folderInfo;
}
}
}
-
Hi, I am having the same error with the following additional details:
I created a folder (I assume the ownership is tied to my User Account)I can't access perform uploads/downloads to this folder with my App (Service Account).
I have authorised my app to 'Act as User'
My app is also authorised to read and write.
What other steps am I missing to deal with this issue of 'collaborator/access'?
Appreciate your help on this.
Thanks! -
This worked for me, thank you!
-
Hi Brielle Purnell, how do you provide the token access to the folder ID? Much appreciated!
-
@Soup - I don't know exactly what you mean. If you are having the same problem as Biswa_Dutta and I, then the solution is to make sure the service account (automated user) has collaborator access to the folder ID. A preliminary step would be to make sure your Client ID and Client Secret are authenticated.
Post is closed for comments.
Comments
6 comments