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.
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
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?
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?
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.
And after changing to the corresponding User ID, I can view the files I want to view.