Skip to main content
Solved

Use List items in folder using access_token through Enterprise ID

  • September 22, 2023
  • 4 replies
  • 187 views

I created the access_token through Enterprise ID.

The authentication method used was Client Credentials Grant.


I obtained the access_token.


I called the ‘List items in folder’ API using this access_token.

I entered 0 for ‘folder_id’.


However, as a result, no error message appeared and ‘total_count’ was output as 0.

Clearly this folder exists.


So I made the same call to the ‘List items in folder’ API using the ‘Developer Token’.

The folder was output normally.


Why can’t I get a list of folders when I create an access_token with ‘enterprise ID’?


reference. If I create an access_token using OAuth 2.0, I can get the list of folders normally.

Thanks.

Best answer by converselabels

Hello,


I understand.

I understood that because the User ID and Enterprise ID are different accounts, the files that can be viewed and the files saved are different.


In order to view User ID files with Enterprise ID, you must select the following option and then obtain authentication from the administrator again.


image


And after changing to the corresponding User ID, I can view the files I want to view.

Thanks.

View original
Did this topic help you find an answer to your question?

4 replies

smartoneinok Box
Forum|alt.badge.img
  • Senior Developer Advocate
  • 181 replies
  • September 22, 2023

Hello 👋,


When you use a developer token, the user the token is associated with is the developer who is logged into the developer console.


When you use an access token you request via the api, the token is associated with the user that requested it - which for CCG is a service account. The output of 0 is because that service account doesn’t have any content currently.


Hope this helps,

Alex, Box Developer Advocate 🥑


  • Author
  • Participating Frequently
  • 6 replies
  • September 23, 2023

Hello~

The user of the developer token and the user who requested the CCG API are the same user ID.

So I find this strange.


Am I missing any parameters or need other settings?

Thanks.


smartoneinok Box
Forum|alt.badge.img
  • Senior Developer Advocate
  • 181 replies
  • September 25, 2023

I think I may have confused you a bit. When you are logged in and click generate developer token, that token is tied to your user’s login. When you create a token via the API for a CCG app using enterprise in the grant type, the token is tied to the CCG app’s service account. They will have two separate folder trees.


The CCG app doesn’t have any content stored in it’s account yet. That is why you see 0 returned. Does that make sense?


  • Author
  • Participating Frequently
  • 6 replies
  • Answer
  • September 26, 2023

Hello,


I understand.

I understood that because the User ID and Enterprise ID are different accounts, the files that can be viewed and the files saved are different.


In order to view User ID files with Enterprise ID, you must select the following option and then obtain authentication from the administrator again.


image


And after changing to the corresponding User ID, I can view the files I want to view.

Thanks.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings