Using API to upload image to a shared folder
AnsweredHi everyone, folow the guide here, I had created a box aplication and upload image to it normally using python jwt library. But the problem is I need to upload images to a shared folder from my collaborator. I can use web widget to upload image manually. The question is how to using API to upload image to a shared folder. Any suggestion with references is nice. Thanks!
-
Here are the steps to do this with JWT authentication:
- Add the App User as a collaborator to the folder with the "uploader" permission
- Generate an access token for that App User and call the Upload File endpoint with that access token
-
You can also use a Service Account for this use case, instead of an App User as I mentioned above.
-
Thanks for very helpful information.
I folowed your referrences and I can upload image to a shared folder that my enterprise account has created. But the user from App User still cannot access to an external shared folder, it's keeping show that "Folder owned by an external collaborator can only be viewed by the user they are collaborating with". Is it possible for App User to access to a folder shared from external collaborator and how. Thank you for spending your time to help me.
-
I has a Developer Account. I had created a Box Aplication and a Service Account
Case A: I had created a "Test" folder, then sharing it for my Service Account via Service Account email => Ok, I can use API to upload image to it.
Case B: Another Box User had created a "TestB" folder, then sharing it to my Service Account via Service Account email => Not Ok, I can't use API to upload image to it. I go to "Dev Console -> Admin Console -> Content Manager, It shows "Folders owned by an externel collaborator can only be viewed by the user they are collaborating with."
Problem: I can use Web Widget to upload image to both "Test" folder and "TestB" folder, but when I use API, I can only upload image to "Test" folder.
Help: Please help me to use API to upload image to "TestB" folder which is shared by another Box User. It had taken me a month stuck with it.
Overview:
-
Thanks for reply ,
The Service Account is assigned as Uploader.
Can I know that if you can see the external user's folder in "Content Manager" or not. In my case, I cannot see the external user's folder in "Content Manager" but the admin account can see it in the main Box interface. I try to get folder ID of the external folder and upload image with it but the response is invalid folder ID
-
Hello Daotran,
the same that you explained happens to me. From the Content Manager view I can not see the folder.
I took the ID of the folder from the URL of the folder itself. I did an upload through API with the configured user and no problem at all to upload it. Strange that you receive an invalid folder ID.
Thanks
Please sign in to leave a comment.
Comments
9 comments