Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
rsd20
6 years agoExplorer | Level 3
API App Authentication Get List of files/folders from public link
Hi i'm looking for some advice on how to do the following and what best route of authentication / api end points I should use,
I need to be able to parse a dropbox business folder (can do this ...
Greg-DB
Dropbox Community Moderator
6 years agoThe Dropbox API doesn't offer a way to get an access token automatically, just from an app key and secret. If you need "background", sometimes called "offline", access like this, you should get and store the refresh token like you described. The refresh token doesn't expire by itself (though can be revoked on demand), so you can store and re-use that to get new access tokens as needed, without manual user interaction.
tribalneck2000
6 years agoExplorer | Level 3
Is this achievable via the .NET client or only via straight http calls?
- Greg-DB6 years ago
Dropbox Community Moderator
tribalneck2000 All of the functionality discussed above is available both via the API v2 HTTPS endpoints themselves, as well as the official Dropbox API .NET SDK.
- tribalneck20006 years agoExplorer | Level 3
Where can I find a sample of exchanging the refresh token for an access token via the .NET API? I have been looking at the repo: https://github.com/dropbox/dropbox-sdk-dotnet
- Greg-DB6 years ago
Dropbox Community Moderator
tribalneck2000 You can find an example of processing the OAuth flow with the .NET SDK here. For example, it uses the RefreshAccessToken method to use a refresh token to get a new access token here.
- tribalneck20006 years agoExplorer | Level 3
I think I am misunderstanding what you are saying about offline access - it sounded like you can call the aquire access token once and grab the refresh token and store it permanently since it doesn't expire.. then all you have to do is call RefreshAccessToken after constructing a DropBoxClient with the refresh token as a param (not sure what you are supposed to put in the ctor param for the access token). That doesn't seem to work.
- tribalneck20006 years agoExplorer | Level 3
Actually I think I got it, read thru the source, there are ctors with just the refresh token. I had a scoping issue that was returning a 400 error. As long as the refresh token can be used forever, I think I may be good for now.
- Greg-DB6 years ago
Dropbox Community Moderator
tribalneck2000 Thanks for following up. I'm glad to hear you've sorted this out. Yes, refresh tokens don't expire by themselves (though the user or app can revoke them if desired).
About Discuss Dropbox Developer & API
Make connections with 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!