Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
amitgaur
3 years agoNew member | Level 2
how to get access token without authorization code in c#
Hi,
Is there any way to generate access token without getting authorization code using only client id and secret key in asp .net core c#? I need only access token to do operations.
or how...
Greg-DB
Dropbox Community Moderator
3 years agoIt is not possible to automatically/programmatically get an access token using just the app key/secret. The app authorization flow needs to be done manually by the user at least once.
Dropbox is no longer offering the option for creating new long-lived access tokens. Dropbox is now issuing short-lived access tokens (and optional refresh tokens) instead of long-lived access tokens. You can find more information on this migration here.
Apps can still get long-term access by requesting "offline" access though, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. You can find more information in the OAuth Guide and authorization documentation. There's a basic outline of processing this flow in this blog post which may serve as a useful example.
If you're using .NET, we recommend using the official Dropbox API v2 .NET SDK. When you use the official Dropbox API v2 .NET SDK, you do not need to implement all of the code for the OAuth flow yourself. The SDK will do most of the work for you. You can find examples of using this here.
harshatupwork
3 years agoExplorer | Level 3
Dear Team,
Thank you for your reply. On my system, if dropbox desktop app is already logged in, is there any way to create document link using code without login or can I get new access token using any api without asking credential from user.
Regards,
Harsh
- Здравко3 years agoLegendary | Level 20
harshatupwork wrote:... On my system, if dropbox desktop app is already logged in, is there any way to create document link using code without login ...
Hi harshatupwork,
Such a feature is supported on Linux only by now. So, if your system is Linux, then Yes, otherwise - No.
harshatupwork wrote:... can I get new access token using any api without asking credential from user.
...
No, there is no way to get either access or refresh token without user be asked. It's partially available on mobile devices only. There the user only need to agree without need to enter again id/email and password, when already logged in to the Dropbox application.
- Greg-DB3 years ago
Dropbox Community Moderator
harshatupwork As Здравко mentioned, there are some command line options for communicating directly with the Dropbox desktop client on Linux only. You can find the information for that here.
Otherwise, you'll need to use the API and authorization flow as documented in the resources in my previous message in this thread.
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!