Hi @nobuhiro_yane ! 🙂
The user ID you mentioned is not a physical user, it’s a service account.
So the folder does exist indeed, but under the Service account folder tree !
That’s why you don’t see it if you’re logged in with your usual user account.
Hello, this is Yane
Thank you for contacting us.
I was able to understand the meaning.
thank you very much. It was helpful.
How to see the folders using service account?
Hi @user67 ! 🙂
You can use the Folders endpoint : https://developer.box.com/reference/get-folders-id-items/
If you select the Folder ID 0, then it will return all the items (files, folders, web links) located on the root of the Service Account. You should use this endpoint :
https://*.app.box.com/folder/0
My issue is when i create a folder or upload a file using default bearer token i am able to see the folder in root directory. when i create a folder or upload a file using generated bearer token i couldnt see the files folders in root 0 dir
I am generating token from comand below
curl -X POST “https://api.box.com/oauth2/token”
-H “Content-Type: application/x-www-form-urlencoded”
-d “grant_type=client_credentials”
-d “client_id=ID”
-d “client_secret=SECRET”
i am using a sandbox account
Hi,
When you use a client credentials grant type (CCG) it is important that you include the box_subject_type
and the box_subject_id
.
I’m not sure what you mean by default bearer token vs generated bearer token.
Do you mean developer token vs CCG token?
What I suspect is happening here is that your are using 2 different bearer tokens that belong to 2 different users.
Event with full permissions the CCG or JWT tokens associated with users or service user accounts, can only access the content that they own or has been shared with then, unless the service accounts are impersonating a use with the as-user
header.
So most likely in your use case, you’re creating a folder or uploading a file with a user and then trying to access it with another user.
If indeed you’re using a developer token, please take into consideration that the token is associated with the user account of the user who created it and not the service account.
You can easily check who’s account you’re working with by calling the /users/me
endpoint or the associated method on all SDK’s.
Let us know if this worked for you.