<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Expiration settings of Temporary Link in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272535#M16183</link>
    <description>&lt;P&gt;Thanks for the replies!&lt;BR /&gt;&lt;BR /&gt;I am a bit confused by the documentation and my result.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;import sys, json, datetime

nowPlusAddedHours = datetime.datetime.now() + datetime.timedelta(hours=24)
nowPlusAddedHours = str(nowPlusAddedHours.isoformat()[:19] + "Z")

if (3,0) &amp;lt;= sys.version_info &amp;lt; (4,0):
    import http.client as httplib
elif (2,6) &amp;lt;= sys.version_info &amp;lt; (3,0):
    import httplib

headers = {
    "Authorization": "Bearer %s" % access_token,
    "Content-Type": "application/json"
}

params = {
    "path": "/FOLDER/FILE.zip",
    "settings": {"requested_visibility":{".tag":"public"},"expires":nowPlusAddedHours}
}

c = httplib.HTTPSConnection("api.dropboxapi.com")
c.request("POST", "/2/sharing/create_shared_link_with_settings", json.dumps(params), headers)
r = c.getresponse()

print r.read()&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that my access token is valid, but i get an error:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;{"error_summary": "settings_error/not_authorized/...", "error": {".tag": "settings_error", "settings_error": {".tag": "not_authorized"}}}&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Apr 2018 09:16:51 GMT</pubDate>
    <dc:creator>mark2mark</dc:creator>
    <dc:date>2018-04-15T09:16:51Z</dc:date>
    <item>
      <title>Expiration settings of Temporary Link</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272061#M16148</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is there a way to set the expiration duration for a Temporary Link in the API? The generated one expires within 4 hours by default. I’m thinking of setting it to 24 hours or so. I’ve seen that it’s possible with the&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-api-v2-explorer/#sharing_create_shared_link_with_settings" target="_blank"&gt;sharing_create_shared_link_with_settings&lt;/A&gt;, but that’s not the kind of link I need/want to use, and also I want to avoid using a UI (or the web link from above).&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:13:59 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272061#M16148</guid>
      <dc:creator>mark2mark</dc:creator>
      <dc:date>2019-05-29T09:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Expiration settings of Temporary Link</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272087#M16151</link>
      <description>No, it's not possible to set arbitrary expirations on those temporary links, but I'll pass this along as a feature request. &lt;BR /&gt;&lt;BR /&gt;Note that you can modify the shared links from sharing_create_shared_link_with_settings for different behaviors if that helps:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.dropbox.com/help/desktop-web/force-download" target="_blank"&gt;https://www.dropbox.com/help/desktop-web/force-download&lt;/A&gt;</description>
      <pubDate>Wed, 11 Apr 2018 13:40:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272087#M16151</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-04-11T13:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Expiration settings of Temporary Link</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272092#M16153</link>
      <description>&lt;P&gt;Thanks for the reply and for forwarding it as a feature request. I&amp;nbsp;can imagine that others can benefit from it as well &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@FBF7D2AB59A0D6E861EBF6A36F93B7E2/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 14:06:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272092#M16153</guid>
      <dc:creator>mark2mark</dc:creator>
      <dc:date>2018-04-11T14:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Expiration settings of Temporary Link</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272309#M16166</link>
      <description>&lt;P&gt;mark2mark,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Greg already linked to the docs on this, but just to be clear...you don't have to use the UI for&amp;nbsp;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;sharing_create_shared_link_with_settings&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;type of links.&amp;nbsp; If you get a shared link with that API and then replace "?dl=0" with "?raw=1"&amp;nbsp;that links will function almost identically to the 4-hour temporary links.&amp;nbsp; That'll probably work for you? The one caveat is that to access the full file data you'll have to follow a redirect or two first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(something I've noticed is that Dropbox never serves the bytes of files directly from the &lt;A href="http://www.dropbox.com.&amp;nbsp;" target="_blank"&gt;www.dropbox.com.&amp;nbsp;&lt;/A&gt; A file's bytes always come from different domain/subdomains)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(also it's pretty ugly that every shared link you get this way has "?dl=0" on it.&amp;nbsp; It seems like it's just telling the server that dl (download) equals 0 (false) which is also the default.&amp;nbsp; If you remove "?dl=0" the links still work fine but now you helpfully have the file/folder name at the end of the URL instead of that query args which is gobbleygook&amp;nbsp;to the majority of people)&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 00:38:22 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272309#M16166</guid>
      <dc:creator>thelwang</dc:creator>
      <dc:date>2018-04-13T00:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Expiration settings of Temporary Link</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272535#M16183</link>
      <description>&lt;P&gt;Thanks for the replies!&lt;BR /&gt;&lt;BR /&gt;I am a bit confused by the documentation and my result.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;import sys, json, datetime

nowPlusAddedHours = datetime.datetime.now() + datetime.timedelta(hours=24)
nowPlusAddedHours = str(nowPlusAddedHours.isoformat()[:19] + "Z")

if (3,0) &amp;lt;= sys.version_info &amp;lt; (4,0):
    import http.client as httplib
elif (2,6) &amp;lt;= sys.version_info &amp;lt; (3,0):
    import httplib

headers = {
    "Authorization": "Bearer %s" % access_token,
    "Content-Type": "application/json"
}

params = {
    "path": "/FOLDER/FILE.zip",
    "settings": {"requested_visibility":{".tag":"public"},"expires":nowPlusAddedHours}
}

c = httplib.HTTPSConnection("api.dropboxapi.com")
c.request("POST", "/2/sharing/create_shared_link_with_settings", json.dumps(params), headers)
r = c.getresponse()

print r.read()&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that my access token is valid, but i get an error:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;{"error_summary": "settings_error/not_authorized/...", "error": {".tag": "settings_error", "settings_error": {".tag": "not_authorized"}}}&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 09:16:51 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272535#M16183</guid>
      <dc:creator>mark2mark</dc:creator>
      <dc:date>2018-04-15T09:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Expiration settings of Temporary Link</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272654#M16194</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/642271"&gt;@mark2mark&lt;/a&gt;&amp;nbsp;Are you using a free account? Note that only paid accounts have access to the link expiration feature. You can find more information under the error documentation for the endpoint:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#sharing-create_shared_link_with_settings&amp;nbsp;" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#sharing-create_shared_link_with_settings&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 15:57:21 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272654#M16194</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-04-16T15:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Expiration settings of Temporary Link</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272961#M16215</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp;I did not see that. Thanks for pointing it out. I got a business account for my company related stuff, but I don’t want to rely on it. I guess I have to wait for the implementation of settings for the temporary link then. I’m aware of that it might not even happen.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 11:13:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Expiration-settings-of-Temporary-Link/m-p/272961#M16215</guid>
      <dc:creator>mark2mark</dc:creator>
      <dc:date>2018-04-18T11:13:20Z</dc:date>
    </item>
  </channel>
</rss>

