cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Musicians, convert your MuseScore files to PDF to play music on the go! Learn more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Dropbox API to get files in a particular folder

Dropbox API to get files in a particular folder

dragon v2
Explorer | Level 3

which dropbox api i can use to get all the files in a particular folder 

 

5 Replies 5

Здравко
Legendary | Level 20

@dragon v2 wrote:

which dropbox api i can use to get all the files in a particular folder 


Hi @dragon v2,

There is pair of access points - /2/files/list_folder/continue - usable to list entire content (files/folders) of a folder or recursive folder tree. 😉 There are equivalent calls in all supported SDKs too.

Hope this helps.

Greg-DB
Dropbox Staff

@dragon v2 Здравко is correct; you should use the endpoints they linked to (or corresponding SDK methods) to list the contents of a folder. The File Access Guide may also be a useful reference.

dragon v2
Explorer | Level 3

@Здравко thanks for the response i have used this but was unable to test it on postman.

 

 

dragon v2
Explorer | Level 3

@Здравко Can you please help me with the steps to test this API in Postman?

 

Здравко
Legendary | Level 20

@dragon v2 wrote:

@Здравко Can you please help me with the steps to test this API in Postman?


Hi @dragon v2,

Hm..🤔 To be honest I'm not quite sure how could help you (what you actually need). On documentation it's clear enough, I think, what every particular query need to be and according to this you may 'instruct' POSTMAN to do that request. If you need POSTMAN related help, take a look on its documentation though. If there is something specific that confuses you, please clarify.

I'll try make some common advices. All common API calls (and their HTTP requests) need valid access token. Every Dropbox access token (issued either using application console or received through OAuth flow - OAuth flow of any kind) is short lived - i.e. it expires after some time (typically 4 hours, but might be different period). You need to make sure you're using valid access token every time you're going to call regular API. For long term access you need so called offline access - i.e. refresh token that doesn't expire automatically. In spite the refresh token cannot be used directly in regular API calls, it lets you regenerate access token (so called refresh) whenever needed (you need valid access token, but the existing token is going to expire or already expired). For exact authorization and refresh steps example you can take a look here. It's not the only possibility, but easy enough to perform by hands (including in POSTMAN).

When you made already sure access token is valid and isn't going to expire, just put it in authorization header as a bearer token. Now if the account represented by the token in use is private one (not team related), you can just call regular user related API. For team account you need to set 'Dropbox-API-Select-User' header at least also (in such a case changing the calls root using 'Dropbox-API-Path-Root' header may be desirable). Don't forget that all regular API calls use JSON formatted transfer for parameters and results. When non content transferring API will be called parameters are in the request body and result in the response body, otherwise in the value of 'Dropbox-API-Arg' request header and result comes as 'Dropbox-API-Result' response header.

Taking in mind the above and following the corresponding API endpoints documentation, usually errors that come back are descriptive enough (despite of not always precisely correct - don't catch to the words always). 😉

Hope this gives direction for the initial steps.

Need more support?