Welcome to the new Box Support website. Check out all the details here on what’s changed.

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

New post

Comments

2 comments

  • Murtza

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

    0
    Comment actions Permalink
  • Lakhs32

    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

     

    0
    Comment actions Permalink

Please sign in to leave a comment.