You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
CHBA
2 years agoExplorer | Level 3
Does the Acces token expire?
I am using Google Apps script to create a PDF file. This is stored in my Google Drive. Yesterday I added to the script that I need a copy of new PDF files send to dropbox. Below is the script I a...
Здравко
Legendary | Level 20
Hi CHBA,
Yes, access token expires (all of them) . Whatever you have read, it's outdated. You need to refresh the access token using refresh token. Take a look here how this can be done without using SDK.
Hope this helps.
CHBA
2 years agoExplorer | Level 3
Hi Здравко
Thanks for a quick reply.
I may end up with another solution as I dont understand how to fix this with a refresh token.
I followed your instruction in the link.
But already here I am stuck:
"In a terminal window execute following curl command:"
curl https://api.dropbox.com/oauth2/token -d code=<received code> -d grant_type=authorization_code -u <App key>:<App secret>
I replace the 'received code', 'App key', and 'App secret' with my own.
When fired off in Powershell, it throws this error after me:
Invoke-WebRequest : Parameter cannot be processed because the parameter name 'u' is ambiguous. Possible matches include
: -UseBasicParsing -Uri -UseDefaultCredentials -UserAgent.
At line:1 char:128
+ ... AAI0RAl8mTa6112h5d6Exxxxxxx -d grant_type=authorization_code -u yamamxxxx ...
+ ~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameter,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
If executed in Git Bash or CMD (I run Windows 11), it gives me this:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 168 100 90 100 78 372 322 --:--:-- --:--:-- --:--:-- 700{"error": "invalid_grant", "error_description": "code has expired (within the last hour)"}
I have tried generating a new token in the App Console under 'Generated access token' and started from the beginning with your guide again, but it didn't seems to change much. The big idiot is stuck 🙂
Why is it saying 'Code has expired within the last hours'? I just generated a new one? I really dont get it..
Even if I did not get this error, I am actually not sure I understand how this works.
I have an app made from Google Appsheet. It is running on a tablet that stays in a public place for people to fill out the form. Whenever they hit SUBMIT the form starts again ready for the next client to fillout the form.
Each form submission goes into my spreadsheet which then creates a PDF based on the data they submitted, and in the end I autoPrint the PDF.
This is where I tried go with Dropbox because the Synchronization goes super fast. The moment google Apps script has created the PDF and sent a copy to Dropbox, the file shows up in the Dropbox drive on the local pc immediately and prints the PDF file to the local printer.
Please bear with me, if you can help me it is super appreaciated. Otherwise I will see if I can find another solution of how to 'Sync' files fast to the pc from cloud.
All the best
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,911 PostsLatest Activity: 7 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!