We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

WMoerke's avatar
WMoerke
Explorer | Level 3
2 years ago

Dropbox API Using .NET SDK Files.ListFolderAsync Returns Empty

I am using the .NET SDK to interact with dropbox, and I cannot get it to return anything when using Files.ListFolderAsync.  I am able to get it to work correctly when using my own personal dropbox, b...
  • Greg-DB's avatar
    2 years ago

    There are a few things to check here:

    • Make sure you're connected to the account that you mean to access. You can use GetCurrentAccountAsync to check the account for the access token you're currently using.
    • Is the access token you're using in that case connected to an app with the "app folder" access type? If so, note that it would only be able to access the special "app folder" created in the account, and not any other folders. App folders are created empty.
    • Is the access token for an account that's on a team that uses the "team space" configuration, and if so, are the files and folders you're expecting to see located in the "team space" or the "member folder"? In that case, if the member folder is empty, you wouldn't get any results since API calls default to the member folder and not the team space. You can information on this, including how to access the team space instead, in the Team Files Guide.
    • Is ListFolderResult.HasMore being returned as true? Note that you're not necessarily guaranteed to get any/all results back on a single page, so if ListFolderResult.HasMore is true, make sure to call back to ListFolderContinueAsync, as documented for ListFolderAsync.

    By the way, for reference, listing the items in a folder requires "files.metadata.read", not "files.content.read", but regardless, you'd get a more specific error if you didn't have the necessary scope authorized, not just an empty list.