You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
IgorTsivan
5 years agoExplorer | Level 4
dropbox Api in js
Hi, help me pls.
I can’t understand the API how to navigate folders and files in my application if I have already displayed the top level of folders and files on the screen. I work with React.js
You can download the file data using the API/SDK. Please refer to my comment here for some information on doing that.
Exactly what you do with the data, e.g., how you display or present it to the user, will depend on your use case.
- Greg-DBDropbox Staff
Can you elaborate on what exactly you're currently stuck on?
To use the Dropbox API from JavaScript, we recommend using the official Dropbox API v2 JavaScript SDK.
With that, you can use the filesListFolder and filesListFolderContinue methods to list the contents of any desired folder, at any level, by passing the full path of the desired folder to filesListFolder.
- IgorTsivanExplorer | Level 4
Thanks for the answer. I am a junior developer and try to understand how to use these methods exactly. The photo shows how I use the filesListFolder method. And I want to clarify how I can move on so that I can navigate folders and open files in my application? I understand that the list_folder / continue method is needed, but how to use it?
I tried to solve this problem for a very long time, and I will be grateful for the help. If necessary, I can attach the entire code. Thanks:)
- Greg-DBDropbox Staff
When you get the response from filesListFolder you need to check the returned FilesListFolderResult.has_more value and if it's true, call back to filesListFolderContinue. Calling filesListFolderContinue works the same way as filesListFolder except that you pass in a 'cursor', from FilesListFolderResult.cursor. It also returns the same FilesListFolderResult type.
To download a file, use the filesDownload and pass in the 'path_lower' for the desired file. Here's an example showing how to access the file data. (It's written for sharingGetSharedLinkFile but it works the same way.)
By the way, you posted your access token in your screenshot. I replaced your screenshot with a redacted version, but for the sake of security, you should disable that access token since it was posted publicly. You can do so by revoking access to the app entirely, if the access token is for your account, here. Or, you can disable just this access token using the API, via HTTP, or JavaScript SDK.
About Discuss Dropbox Developer & API
Make connections with other developers797 PostsLatest Activity: 12 hours ago
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!