Skip to main content
Question

Cant get the root folder of the user from the admin api

  • May 21, 2025
  • 2 replies
  • 5 views

Forum|alt.badge.img

i have used admin credentials to eastablish connection to box and i have created some users under my account. i am not able to traverse to the root folder of particular user based on userid. so is there any api to get to root folder id of particular user from admin api?(Java)

2 replies

Forum|alt.badge.img

 You can access a Managed User's content with an access token scoped to an Admin using the As-User Header. To specify the user's root folder in the Get Folder's Items call, set the folder_id parameter to "0".


Forum|alt.badge.img

I am trying to use admin client id ,client sercret,access token,refresh token)

 

BoxAPIConnection api = new BoxAPIConnection(cientId, cientSecret, accessToken, refreshToken);

 // for users inforamtion

api.setRequestInterceptor(new RequestInterceptor() {
            @Override
            public BoxAPIResponse onRequest(BoxAPIRequest request) {
                request.addHeader("As-User", "access-id");

                // Returning null means the request will be sent along with our new header.
                return null;
            }
            });

 BoxFolder folder=new BoxFolder(api,"0");

 

 

this still gives me 401 status