<?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: Share a file, then return the URL ONLY in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Share-a-file-then-return-the-URL-ONLY/m-p/217547#M11364</link>
    <description>&lt;P&gt;I'm not too familiar with de-serializing JSON in python, but you are getting a JSON object if you convert that JSON into an object you can just retrieve the URL member of that object&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2017 06:36:06 GMT</pubDate>
    <dc:creator>JohnnyNPC</dc:creator>
    <dc:date>2017-04-24T06:36:06Z</dc:date>
    <item>
      <title>Share a file, then return the URL ONLY</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Share-a-file-then-return-the-URL-ONLY/m-p/217488#M11359</link>
      <description>&lt;P&gt;I am using Python to share an image. &amp;nbsp;Then, I want to be able to only print to the console the short url. How do I accomplish this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With this: &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;print(client.share(path))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{'visibility': 'PUBLIC', 'expires': 'Tue, 01 Jan 2030 00:00:00 +0000', 'url': 'https://....'}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;https://....&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is greatly appreciated!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:23:25 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Share-a-file-then-return-the-URL-ONLY/m-p/217488#M11359</guid>
      <dc:creator>mnoah66</dc:creator>
      <dc:date>2019-05-29T09:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Share a file, then return the URL ONLY</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Share-a-file-then-return-the-URL-ONLY/m-p/217547#M11364</link>
      <description>&lt;P&gt;I'm not too familiar with de-serializing JSON in python, but you are getting a JSON object if you convert that JSON into an object you can just retrieve the URL member of that object&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 06:36:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Share-a-file-then-return-the-URL-ONLY/m-p/217547#M11364</guid>
      <dc:creator>JohnnyNPC</dc:creator>
      <dc:date>2017-04-24T06:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Share a file, then return the URL ONLY</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Share-a-file-then-return-the-URL-ONLY/m-p/217676#M11373</link>
      <description>&lt;P&gt;The &lt;A href="https://www.dropbox.com/developers-v1/core/docs/python#DropboxClient.share" target="_self"&gt;share&lt;/A&gt; method you're using returns a dict, so you can access the fields like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;print(client.share(path)['url'])&lt;/PRE&gt;
&lt;P&gt;That uses API v1 though, which is &lt;A href="https://blogs.dropbox.com/developers/2016/06/api-v1-deprecated/" target="_self"&gt;deprecated&lt;/A&gt;. You should switch to using &lt;A href="https://www.dropbox.com/developers/documentation/python#tutorial" target="_self"&gt;API v2&lt;/A&gt;. Using API v2, creating a shared linked is accomplished using the &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.dropbox.Dropbox.sharing_create_shared_link_with_settings" target="_self"&gt;sharing_create_shared_link_with_settings&lt;/A&gt;&amp;nbsp;method, which returns a &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.sharing.SharedLinkMetadata" target="_self"&gt;SharedLinkMetadata&lt;/A&gt;&amp;nbsp;object. Using it would look like this (also including the construction of the client itself):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;dbx = dropbox.Dropbox(ACCESS_TOKEN)&lt;BR /&gt;print(dbx.sharing_create_shared_link_with_settings(path).url)&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Apr 2017 00:55:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Share-a-file-then-return-the-URL-ONLY/m-p/217676#M11373</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-04-25T00:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Share a file, then return the URL ONLY</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Share-a-file-then-return-the-URL-ONLY/m-p/217710#M11382</link>
      <description>&lt;P&gt;That worked! &amp;nbsp;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 00:44:08 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Share-a-file-then-return-the-URL-ONLY/m-p/217710#M11382</guid>
      <dc:creator>mnoah66</dc:creator>
      <dc:date>2017-04-25T00:44:08Z</dc:date>
    </item>
  </channel>
</rss>

