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

AlecF's avatar
AlecF
Explorer | Level 4
3 years ago

Node/JS SDK - /get_temporary_link

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 !

    • AlecF's avatar
      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 !

      • Здравко's avatar
        Здравко
        Legendary | 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.

        ...

        ...

         

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

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

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,882 PostsLatest Activity: 3 years ago
325 Following

If 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!