cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
If you know more about files sizes, you can make more informed decisions about which files you upload and then you can maximize the space in your Dropbox Basic account?

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

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

Re: Node/JS SDK - /get_temporary_link

Здравко
Super Collaborator | Level 20

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

Re: Node/JS SDK - /get_temporary_link

Здравко
Super Collaborator | Level 20

Hi @AlecF,

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

Hope this helps.

Re: Node/JS SDK - /get_temporary_link

AlecF
Explorer | Level 4

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 !

Re: Node/JS SDK - /get_temporary_link

Здравко
Super Collaborator | Level 20

@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.

...

...

 

Re: Node/JS SDK - /get_temporary_link

Greg-DB
Dropboxer

(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.

Re: Node/JS SDK - /get_temporary_link

AlecF
Explorer | Level 4

@Greg-DB 

 

thanks !!!

Who's talking

Top contributors to this post

  • User avatar
    AlecF Explorer | Level 4
  • User avatar
    Greg-DB Dropboxer
  • User avatar
    Здравко Super Collaborator | Level 20
What do Dropbox user levels mean?
Need more support?