cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Node/JS SDK - /get_temporary_link

Node/JS SDK - /get_temporary_link

AlecF
Explorer | Level 4
Go to solution

Hello,

 

getting started w/ Dropbox and have a couple of questions re /get_temporary_link.

 

(1) I saw that the Java SDK has a direct method for `.get_temporary_link()`, see here , but I cannot find the equivalent in the Node/JS SDK... is it missing ?

 

(2) is it possible to reduce the lifetime of a temp link (via SDK, HTTP API or global setting) ? I believe the default is 4 hours, is there any chance to bring it down to like 10 mins ?

 

Thanks !

1 Accepted Solution

Accepted Solutions

Здравко
Legendary | Level 20
Go to solution

Hi @AlecF,

To find the function you are looking for, take a look here. 😉

Hope this helps.

View solution in original post

5 Replies 5

Здравко
Legendary | Level 20
Go to solution

Hi @AlecF,

To find the function you are looking for, take a look here. 😉

Hope this helps.

AlecF
Explorer | Level 4
Go to solution

Hi Здравко,

 

thanks for that, I see that the function is called 

 

.filesGetTemporaryLink(arg)

 

in the Node SDK... 

 

But re my question (2), I assume in order to set a custom TTL, I'd rather have to use 

 

sharingCreateSharedLinkWithSettings(arg)

 

and then specify a custom value in expires parameter ?

 

Which brings me to another question, what is the format of the timestamp string ?

 

The definition for Timestamp listed here simply says "string", which could mean anything...

 

Thanks !

Здравко
Legendary | Level 20
Go to solution

@AlecF wrote:

...

Which brings me to another question, what is the format of the timestamp string ?

...


Take a look on 2/sharing/create_shared_link_with_settings (in parameters section):


...
settings SharedLinkSettings? The requested settings for the newly created shared link. This field is optional.

SharedLinkSettings

require_password Boolean? Boolean flag to enable or disable password protection. This field is optional.

link_password String? If require_password is true, this is needed to specify the password to access the link. This field is optional.

expires Timestamp(format="%Y-%m-%dT%H:%M:%SZ")? Expiration time of the shared link. By default the link won't expire. This field is optional.

...

...

 

Greg-DB
Dropbox Staff
Go to solution

(1) That's correct, in particular, it's the filesGetTemporaryLink method.

 

(2) The Dropbox API doesn't offer a way to customize the lifetime of temporary links from filesGetTemporaryLink in particular, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. As you found, you can instead use sharingCreateSharedLinkWithSettings to create shared links with optional arbitrary expiration, as long as the account has access to that feature. The Dropbox API uses the ISO 8601 "combined date and time representation" format for timestamps.

AlecF
Explorer | Level 4
Go to solution

@Greg-DB 

 

thanks !!!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    AlecF Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?