Skip to main content
Question

Error:"Invalid value 'd_xxxxxxxxxx2'" while using Box config file

  • May 22, 2025
  • 6 replies
  • 145 views

Forum|alt.badge.img

Hi 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;
}
}
}

6 replies

Forum|alt.badge.img

:

 

This usually indicates that the token you're using does not own or have collaborator access to the folder ID you're passing in. 

 

Best, 

Kourtney

Box Technical Support Engineer


Forum|alt.badge.img

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!


Forum|alt.badge.img

Hi Kourtney,

This usually indicates that the token you're using does not own or have collaborator access to the folder ID you're passing in. 

If so how to do to own?


Forum|alt.badge.img

23426911768

This worked for me, thank you!


Forum|alt.badge.img

Hi 1519742835662, how do you provide the token access to the folder ID? Much appreciated! 


Forum|alt.badge.img

@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.