Discuss Dropbox Developer & API
We use Dropbox to store pictures from every jobsite we work on. The estimator puts his pics in the folder for the crews to view and later the crews put their images in the same folder. I have been using an Azure logic app to create the folders I need by using a constructed folder path and creating a txt file. I then delete the file afterwards. But I can't find any way to get the public link for the folder using Logic Apps.
I can do it in Zappier but that just gets stupid expensive in short order.
Has anyone found a way to get the public link?
Worked perfectly, Thank you. do I now just use the refresh token as the access token in all of my http calls?
Authorization: Bearer <Refresh token>
@Jeff B.63 wrote:Worked perfectly, Thank you. do I now just use the refresh token as the access token in all of my http calls?
Authorization: Bearer <Refresh token>
No, no, no,... definitely NO!
Refresh token doesn't replace access token, neither opposite! The refresh token is only used for refreshing (regenerating in fact) access token, nothing more. As I mentioned there (and as seems you skipped) in regular API calls valid access token (non expired - within the timespan as described) should be use. If needed (after currently used token expires), execute the last call in my description before next regular API call. ![]()
Hope it's a bit more clear now.
Thank you for your help Здравко, I read your other directions more clearly and it worked great.
My next challenge was how to use the refresh token in my Logic App. After an awful lot of searching, I was able to cobble something together.
For anyone else finding this thread, I will include that information for them below:
Maybe there is a simpler way to do this but this is all I could figure out with my very limited knowledge.
Hi @Jeff B.63,
Congratulations to you for your solution!
I believe your sharing will help many other people working on the same environment.
There are some imperfections though that push your solution to the border of stability. There is small but real chance some of your API calls to fail authentication! Of course in such a situation the details are important (something I don't know), but in all cases minimizing assumptions in the code is a good idea (they may play bad game
).
@Jeff B.63 wrote:...
4. I retrieve the blob metadata and use a condition to check if utcNow() > (LastModified timestamp + 4 hrs).
...
When something is NOT guaranteed in any way better don't rely on! Yes, typically access token validity period is 4hr, but again typically NOT mandatory (may be less). I gave it just as example, nothing more. I mentioned in explicit way that validity is denoted in "expires_in" field. You're ignoring this value in favor of assumption! In addition it's good idea to "cut" 2, 3, or 5 mins out from validity period, cosa there are always some delays in token receiving, calculations, etc. - something that accumulates and can... make your check wrong (and you code tries work with just expired token in some cases).
@Jeff B.63 wrote:...
7. Finally, right after the Until, I initialize a variable to hold the current token and use it in the HTTP Dropbox API actions I have later in the flow.
...
Hm...
How long is this flow of actions? Is there any chance for your token expiration meantime? Important detail! It's good idea to check for token validity at the beginning of every API call, not at the beginning of flow of calls - just to make the things more secure. Even more in such a way you don't need additional trigger - the call, you're going to do, itself is a trigger. ![]()
Good luck to you and all others interested.
Thank you for that input, I will work on that and revise the post. I put the loop in place so that if there was delay in getting the new token the loop would continue until the token was available. But I understand your concerns and will add a reference to the validity period in the blob and use it in the condition instead of just 4 hour minus a few minus of course.
Hi there!
If you need more help you can view your support options (expected response time for a 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!