REST API get permission of document and folder for current user

Highlighted
First-time Contributor

REST API get permission of document and folder for current user

 

Hi all,

I want to get permission from the folder and file for the current user.

But I can not still found the available REST API to resolve this problem.

 

This is Network element in Chrome from box website, it has an API that returns all info (such as name, permission)

 

All_Files___Powered_by_Box.png

 

Please help if any meet this problem

 

Thanks,

Danh

1 REPLY 1
Highlighted
Box Employee

Re: REST API get permission of document and folder for current user

Hi @danhnguyentk,

 

I'm not 100% sure of what you're looking to do. Is it that you have an application with those permissions, and want to get a file for another user but it's not working?

 

If so, this is most likely due to the access token that you have being scoped for a different user. For instance, when you first authenticate as a JWT application, you'll typically be referencing the service account, instead of a user. You will need to do 1 of two things:

  • Make a request using the as-user header, or generate a user access token for the account that owns the file. You can then use the request to get a file / folder.
  • Collaborate the service account into the file / folder that you would want to have access to. This will allow the service account itself permission to get that file.

Hope that helps, but if there's something else going on please let me know and I can try to provide some additional guidance.