We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
PHAnetwork
9 months agoHelpful | Level 5
Python API Short-lived access token for Dropbox
I may not be fully understanding this, but here's the issue. I'm trying to get a short-lived token that can be used repeatedly. The first time through, I am prompting through the command line. I can ...
- 9 months ago
Okay, I see the problem, and now realize that it's time for me to retire from this business😔!!
I was pasting the initial code from the Dropbox authorization section, which is used to obtain the access token instead of the actual access token. That's where the confusion was. I'm familiar with what the access token should look like, so I'm not sure why I didn't recognize that earlier.
It's working now. Thanks for your help and patience!
PHAnetwork
Helpful | Level 5
Thanks for the reply!
So, what I'm doing is capturing the generated access token, and then trying to use that later on. Here is the code that uses that token.
access_token = "{ACCESS_TOKEN_PASTED_HERE}"
dbx = Dropbox(access_token)
I copy the token generated in the previous Python code and then paste it here. The token works once on the initial generation, but if I try to use the same token a second time it shows as invalid.
Does that mean that this is NOT a short-lived access token? Do I need to refresh this token in the example here and if so, how do I do that with the Python API. I couldn't find anything in the documents about this.
Thanks
Здравко
9 months agoLegendary | Level 20
PHAnetwork, What is the meaning of word "short" (either about token or whatever else)? 🧐
Of course, I hope you know. In the same context why are you surprised that a short-lived access token expires?
Your code is wrong (the second part) of course. As I supposed you have skipped the refresh token (part of the result also). In addition you have to add the applications key and secret (needed for automated token refreshing).
Hope this gives direction.
- PHAnetwork9 months agoHelpful | Level 5
Actually, it's the Refresh Token process that I'm struggling with. I can't seem to find out how to request a refresh token using the Python API.
- Здравко9 months agoLegendary | Level 20
Здравко wrote:... As I supposed you have skipped the refresh token (part of the result also). ...
PHAnetwork wrote:... I can't seem to find out how to request a refresh token using the Python API.
Do I need to say (or rather repeat) that you have it done already? 🤔
- PHAnetwork9 months agoHelpful | Level 5
Okay, still confused.
You said, "As I supposed you have skipped the refresh token" and then you said, "I have done it already". Did I skip the refresh token, or did I do it correctly?
Sorry, but your reply really didn't help.
About Discuss Dropbox Developer & API
Make connections with other developers
795 PostsLatest Activity: 7 days 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!