We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
WMoerke
2 years agoExplorer | Level 3
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...
- 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.
Greg-DB
Dropbox Staff
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.
WMoerke
2 years agoExplorer | Level 3
Hi Greg, thanks for the reply.
I was able to confirm that it is the correct account by using GetCurrentAccountAsync. Unfortunately, when I was confirming with my client that he created the app with full dropbox access he wasn't sure and decided to delete it and create it over again. After he did that I am having a bit of a different error. I am now getting an exception saying my app does not have the required scope 'files.metadata.read'. My client sent me a screenshot of the permissions though, and that scope is checked. Is it possible it takes a while for the permissions to kick in?
- Greg-DB2 years agoDropbox Staff
There isn't a delay, but note that scope changes are not retroactive. That is, if you enable a scope on an app, that does not retroactively add that scopes to existing tokens that were authorized before the scope was enabled. If the scope was enabled after connecting the app, the user would need to authorize the app again to grant the newly enabled scope.
- WMoerke2 years agoExplorer | Level 3
It turns out the problem with this was that my client didn't realize he needed to hit the submit button at the bottom after changing permissions. After he did that and I got a new refresh token, I am now able to see the folder structure using Files.ListFolderAsync. I am not sure what the issue was before where I got an empty list returned from ListFolderAsync, but that seems to be cleared up now.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 5 hours agoIf 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!