cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We love to hear how every person gets the most from Dropbox, and it seems everyone has a slightly different use for it - tell us yours here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue with temporary link, related to refresh tokens?

Issue with temporary link, related to refresh tokens?

raRaRa
Helpful | Level 6

Hi all.

 

I noticed this error when opening a temporary link that my app has recently created (under 1 hour), with the status code 410 (Gone).

{"error": "Unauthorized"}

 

However, I usually get "Not Found" error message when a temporary link has expired, but the newly created temporary link above shows the Unauthorized error when opening it.

{"error": "Not Found"}

 

I'm now wondering if this is related to refreshing access tokens, causing all previous temporary links to expire automatically. If that's the case, then I'd need to re-create hundreds of temporary links every time the access token is refreshed, which is not very friendly experience.

 

I hadn't noticed this issue until recently when I migrated to refreshing access tokens.

1 Accepted Solution

Accepted Solutions

Re: Issue with temporary link, related to refresh tokens?

Greg-DB
Dropboxer

@raRaRa First, for reference, note that performing a refresh does not itself invalidate any previous short-lived access tokens for that refresh token, or any temporary links created using those previous short-lived access tokens. However, due to how temporary links are implemented, they are reliant on the validity of the access token used to create them. That means that once a particular short-lived access token expires (or is revoked), any temporary links created by that access token will also become invalid (even if they have not yet expired themselves).

 

So, in your case, you may want to proactively create a new short-lived access token when you need to create a new temporary link, so you can get about the full four hours on the temporary link. (Creating a new short-lived access token does not invalidate previous ones.)

 

@mhaind It sounds like you may be experiencing a different issue. This thread is referring to a problem using "temporary links" with the Dropbox API, but it sounds like you're running in to an issue using "shared links" with the Dropbox product itself. You should contact support for help with that.

View solution in original post

4 Replies 4

Re: Issue with temporary link, related to refresh tokens?

mhaind
New member | Level 2

I'm also facing the same issue after I migrated from the Individual / PersonalPlus plan to the Business /Work Advanced plan. 

All the previously created share links are not working and also unable to create any new links or invite team members. 

Re: Issue with temporary link, related to refresh tokens?

raRaRa
Helpful | Level 6

Here's an example temporary link to a video that has the Unauthorized error:

https://content.dropboxapi.com/apitl/1/AzeC6wBydKaQhlthVkgCC5H5NDO7HPugwMhW5PIqKYhGGhpkvDeTRAUfsI6Nh...

 

The only thing that changed was that the access token was refreshed and a new temporary link was created since the old link was about to expire.

Here's the old temporary link to the video file:

https://content.dropboxapi.com/apitl/1/AzfOdVW6K3UM4GcZMhCpIx-ovrjm8HqrLLvX-Ql-1TA2Jgwskgy--V0bhfvAi...

 

And it currently has the error "The link has expired", which is expected:

{"error": "The link has expired."}

 

When the unauthorized link actually expires, the unauthorized error will change to the link has expired error.

Re: Issue with temporary link, related to refresh tokens?

Greg-DB
Dropboxer

@raRaRa First, for reference, note that performing a refresh does not itself invalidate any previous short-lived access tokens for that refresh token, or any temporary links created using those previous short-lived access tokens. However, due to how temporary links are implemented, they are reliant on the validity of the access token used to create them. That means that once a particular short-lived access token expires (or is revoked), any temporary links created by that access token will also become invalid (even if they have not yet expired themselves).

 

So, in your case, you may want to proactively create a new short-lived access token when you need to create a new temporary link, so you can get about the full four hours on the temporary link. (Creating a new short-lived access token does not invalidate previous ones.)

 

@mhaind It sounds like you may be experiencing a different issue. This thread is referring to a problem using "temporary links" with the Dropbox API, but it sounds like you're running in to an issue using "shared links" with the Dropbox product itself. You should contact support for help with that.

View solution in original post

Re: Issue with temporary link, related to refresh tokens?

raRaRa
Helpful | Level 6

@Greg-DB Thank you so much for the clarification, that makes sense. Like you explained, I think the best solution for me is to create a new short lived access token every time before I create new temporary links, just to make sure that the full 4 hours are utilized.

 

Thank you again!

Who's talking

Top contributors to this post

  • User avatar
    raRaRa Helpful | Level 6
  • User avatar
    Greg-DB Dropboxer
  • User avatar
    mhaind New member | Level 2
What do Dropbox user levels mean?
Need more support?