Root folder returns 0 files
Hello,
I'm calling...
https://api.box.com/2.0/folders/0/items
...to get to get the items of my root folder, but the return says that my "total_count" is "0" items. Obviously, I know I have several folders in this root folder, so can anyone tell me if they've had experience with this. If so, what was the fix?
Details:
I'm using Swift's URLSession API.
Getting auth tokens without a problem for the enterprise, then for the user of the app.
Attempted solutions:
I've tried this call using both the enterprise AND the user token, but both return the same result.
Have tried setting the app on Box as User and Enterprise, and both have failed.
Reauthorized the app--that didn't work either.
If you need me to clarify, please ask, and I will be happy to do so.
Thank you in advance!
-
Good afternoon ,
probably it is related to the user you are using.
The enterprise token is authorizing you using the service account user that won't have access to your root folder. So, the right way to do it is by the user token but... how are you using that? are you using an app user or are you using your own mail? with the latter should work.
Regards
-
Thank you very much for your interest in helping me, !
Basically what I'm trying to do is have my iOS app download content from several json files I have stored in a box folder. I don't want the app user doing anything with Box. I was using a static link at first, but that was unreliable, so I decided to go with the api.
So, now that you have a little more context of what I'm trying to do, you'll understand why I just want access to the root folder, so that I can know which folder ID to go to in order to get my files. Hence why I'm doing the two-step JWT method.
To answer your questions: What I've discovered is that I'm creating a user each time I start my app. What's more, is that all of these user, by default, don't have access to any of my folders. I really don't want to create a user each time, and I definitely want the user to have access to my folders.
I don't know how I would use my own email to gain access to anything unless I do the JWT in the 3-step process; moreover, I don't think I'd be comfortable hardcoding my email and other information into an app I plan on putting out for public use.
I hope that helps clarify my question.
-
Good morning ,
the AppUsers that you create behave as regular managed users. That means that they have to be invited to specific folders to see the documents and upload documents to that specific location. You can create an appuser and use always that one . No need to create an appuser everytime. In case that you want to have as many appusers as real users connecting to your application, you will need to create the user, a folder specific for it and add as a collaborator to have access to that info.
The root folder can not be shared so you will have to share the subfolders created there or create a "root" subfolder and place inside what you want to share .
Thanks
サインインしてコメントを残してください。
コメント
3件のコメント