Skip to main content
Question

Java SDK Downscope to Folder - unable to determine resource type

  • May 22, 2025
  • 2 replies
  • 17 views

Forum|alt.badge.img

I am attempting to use Token Exchange with the Box Java SDK to be used with the Content Picker UI element. I would like to limit my users to have access to a single folder based on custom user variables from my website. However, whenever I try downscoping the access token to a folder resource I get:

com.box.sdk.BoxAPIException: Unable to determine resource type: https://api.box.com/2.0/folders/... at com.box.sdk.BoxAPIConnection.getLowerScopedToken(BoxAPIConnection.java:785)

I investigated the getLowerScopedToken function and it seems like it only accounts for file resources, not folders. In determineResourceLinkType(), the only endpoint patterns addressed are for files and links with no /folders/ endpoint.

I see here that it's possible to downscope to a folder with cURL.

Is it possible to downscope to a specific folder with the Java SDK? Do I need to do the POST request from scratch? Is that allowed?

Thanks

2 replies

Forum|alt.badge.img

Hi!

This was fixed in this release, so as long as you are using vs v2.50.1 or higher it should be there!

Thanks, 

Alex, Box Developer Advocate


Forum|alt.badge.img

It works now, thanks so much. Btw you should probably update the version listed here: http://opensource.box.com/box-java-sdk/.