Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

saravananct143's avatar
saravananct143
Explorer | Level 3
8 years ago

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

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

6 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago

    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's avatar
    saravananct143
    Explorer | Level 3
    8 years ago

    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's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago

    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's avatar
    saravananct143
    Explorer | Level 3
    8 years ago

    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"

  • chirstius's avatar
    chirstius
    Icon for Dropbox Staff rankDropbox Staff
    8 years ago

    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

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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, Facebook or Instagram.

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!