cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: How to get the Dropbox File List using httpclient or WebRequest?

How to get the Dropbox File List using httpclient or WebRequest?

saravananct143
Explorer | Level 3

How to get the Dropbox File List using httpclient or WebRequest?

6 Replies 6

Greg-DB
Dropbox Staff

In order to list the contents of a folder, you should use /2/files/list_folder and /2/files/list_folder/continue

 

It sounds like you're referring to using .NET, so we recommend using the official API v2 .NET SDK. It has corresponding ListFolder and ListFolderContinue methods.

 

If can't or don't want to though, you can make the HTTPS requests directly to the HTTPS endpoints. The /2/files/list_folder and /2/files/list_folder/continue documentation covers the expected format, and contains curl examples you can translate for your preferred HTTPS client.

saravananct143
Explorer | Level 3

Thanks for Reply,

 

POST /2/sharing/list_folders

Host: https://api.dropboxapi.com

User-Agent: api-explorer-client

Authorization: Bearer <REDACTED>

Content-Type: application/json

 

I'm trying this in postman. But i'm not get any values. One more doubts.  How can i generate the AccessToken ?. My Project requirement without dropbox client dll, through api's i need to get the data.

Greg-DB
Dropbox Staff

What was in the HTTPS response? It should either contain an error or the result.

 

Also, I redacted it for you, but you should revoke that access token since you posted it publicly.

 

It looks like you already figured out how to get an access token, since you posted one, but for reference, the OAuth guide goes over how to.

saravananct143
Explorer | Level 3

https://api.dropboxapi.com/2/auth/token/from_oauth1

 

Authorization: Basic appkey:appsecret

Content-Type: application/json

 

Error in call to API function "auth/token/from_oauth1": Invalid value in HTTP header "Authorization": "Basic appkey:appsecret"

saravananct143
Explorer | Level 3

https://www.dropbox.com/oauth2/authorize?client_id=...&redirect_uri=...)

this url i'm getting this error 

Error (400)</h1>It seems the app you were using submitted a bad request. If you would like to report this error to the app's developer, include the information below.

chirstius
Dropbox Staff

Hey @saravananct143 before we dive into your original issue, or even generating a new token, I'd really like to verify that you were able to revoke your previous token. This way we know we're working from a clean slate and any data accessible via the previous token is protected going forward.

 

Can you confirm?

 

If you're not sure how to revoke a token, one of the easiest ways is to use the Dropbox API Explorer to call /token/revoke. You can find that here: https://dropbox.github.io/dropbox-api-v2-explorer/#auth_token/revoke

Just paste in your previous token, submit the call, and you should be good to go.

 

-Chuck

Need more support?