<?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 How to insert a picture from the application on the site? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-insert-a-picture-from-the-application-on-the-site/m-p/379056#M21217</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi Dropbox!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Now I am learning Django, I am creating the first application.&lt;/SPAN&gt; &lt;SPAN&gt;Deployed this application to Heroku.&lt;/SPAN&gt; &lt;SPAN&gt;As a file storage for pictures, I decided to use Dropbox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Now I am adding a picture to record Django in the admin panel and it will appear in the Dropbox application, but I don’t understand how to get a link to it (so that it appears on the site).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do this:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;dbx = dropbox.Dropbox(settings.DROPBOX_OAUTH2_TOKEN)
    shared_link_metadata = dbx.sharing_create_shared_link_with_settings("/" + str(post.images))

    print(shared_link_metadata)&lt;/PRE&gt;&lt;P&gt;to view.py&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I get:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;ApiError('6d0d5986e4daa4aa3cb644556bd30989', CreateSharedLinkWithSettingsError('shared_link_already_exists', SharedLinkAlreadyExistsMetadata('metadata', FileLinkMetadata(url='https://www.dropbox.com/s/55dbx3w7hq6ejp2/regular_picture-e8d4091b6a6d555b697bac3f9af0d728.jpg?dl=0', name='regular_picture-e8d4091b6a6d555b697bac3f9af0d728.jpg', link_permissions=LinkPermissions(can_revoke=True, resolved_visibility=ResolvedVisibility('public', None), requested_visibility=RequestedVisibility('public', None), revoke_failure_reason=None, effective_audience=None, link_access_level=None), client_modified=datetime.datetime(2019, 11, 17, 11, 53, 39), server_modified=datetime.datetime(2019, 11, 17, 11, 53, 39), rev='01597897b57ca2a000000018cea2e10', size=79820, id='id:jC4nvt6nxLAAAAAAAAAAUg', expires=None, path_lower='/media/regular_picture-e8d4091b6a6d555b697bac3f9af0d728.jpg', team_member_info=None, content_owner_team_info=None))))&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Help please ...&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 17 Nov 2019 14:09:41 GMT</pubDate>
    <dc:creator>Legalas61</dc:creator>
    <dc:date>2019-11-17T14:09:41Z</dc:date>
    <item>
      <title>How to insert a picture from the application on the site?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-insert-a-picture-from-the-application-on-the-site/m-p/379056#M21217</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Dropbox!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Now I am learning Django, I am creating the first application.&lt;/SPAN&gt; &lt;SPAN&gt;Deployed this application to Heroku.&lt;/SPAN&gt; &lt;SPAN&gt;As a file storage for pictures, I decided to use Dropbox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Now I am adding a picture to record Django in the admin panel and it will appear in the Dropbox application, but I don’t understand how to get a link to it (so that it appears on the site).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do this:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;dbx = dropbox.Dropbox(settings.DROPBOX_OAUTH2_TOKEN)
    shared_link_metadata = dbx.sharing_create_shared_link_with_settings("/" + str(post.images))

    print(shared_link_metadata)&lt;/PRE&gt;&lt;P&gt;to view.py&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I get:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;ApiError('6d0d5986e4daa4aa3cb644556bd30989', CreateSharedLinkWithSettingsError('shared_link_already_exists', SharedLinkAlreadyExistsMetadata('metadata', FileLinkMetadata(url='https://www.dropbox.com/s/55dbx3w7hq6ejp2/regular_picture-e8d4091b6a6d555b697bac3f9af0d728.jpg?dl=0', name='regular_picture-e8d4091b6a6d555b697bac3f9af0d728.jpg', link_permissions=LinkPermissions(can_revoke=True, resolved_visibility=ResolvedVisibility('public', None), requested_visibility=RequestedVisibility('public', None), revoke_failure_reason=None, effective_audience=None, link_access_level=None), client_modified=datetime.datetime(2019, 11, 17, 11, 53, 39), server_modified=datetime.datetime(2019, 11, 17, 11, 53, 39), rev='01597897b57ca2a000000018cea2e10', size=79820, id='id:jC4nvt6nxLAAAAAAAAAAUg', expires=None, path_lower='/media/regular_picture-e8d4091b6a6d555b697bac3f9af0d728.jpg', team_member_info=None, content_owner_team_info=None))))&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Help please ...&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2019 14:09:41 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-insert-a-picture-from-the-application-on-the-site/m-p/379056#M21217</guid>
      <dc:creator>Legalas61</dc:creator>
      <dc:date>2019-11-17T14:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert a picture from the application on the site?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-insert-a-picture-from-the-application-on-the-site/m-p/379213#M21220</link>
      <description>&lt;P&gt;That 'shared_link_already_exists' error indicates that the call failed because a shared link for the requested item already exists.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can either get the shared link information from the &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/sharing.html#dropbox.sharing.SharedLinkAlreadyExistsMetadata" target="_self"&gt;SharedLinkAlreadyExistsMetadata&lt;/A&gt;, if given in the &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/sharing.html#dropbox.sharing.CreateSharedLinkWithSettingsError" target="_self"&gt;CreateSharedLinkWithSettingsError&lt;/A&gt; error, as shown in your output, or call&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.sharing_list_shared_links" target="_self"&gt;sharing_list_shared_links&lt;/A&gt; to retrieve it. (Likewise, you can call&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.sharing_list_shared_links" target="_self"&gt;sharing_list_shared_links&lt;/A&gt;&amp;nbsp;first, to check for a shared link, if you prefer.)&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 15:33:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-insert-a-picture-from-the-application-on-the-site/m-p/379213#M21220</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-11-18T15:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert a picture from the application on the site?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-insert-a-picture-from-the-application-on-the-site/m-p/379242#M21221</link>
      <description>&lt;P&gt;Thanks for the advice! The method helped to get the link,&lt;/P&gt;&lt;PRE&gt;&amp;lt;img class="main_img" src="'https://www.dropbox.com/s/55dbx3w7hq6ejp2/regular_picture-e8d4091b6a6d555b697bac3f9af0d728.jpg?dl=0" alt="***"&amp;gt;&lt;/PRE&gt;&lt;P&gt;but the browser does not display the image. Can I get a direct link, not a download link?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 17:13:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-insert-a-picture-from-the-application-on-the-site/m-p/379242#M21221</guid>
      <dc:creator>Legalas61</dc:creator>
      <dc:date>2019-11-18T17:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert a picture from the application on the site?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-insert-a-picture-from-the-application-on-the-site/m-p/379256#M21222</link>
      <description>&lt;P&gt;Yes, if you need direct links, you can modify the shared links returned by&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.sharing_list_shared_links" target="_self" rel="nofollow noopener noreferrer"&gt;sharing_list_shared_links&lt;/A&gt;&amp;nbsp;or &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.sharing_create_shared_link_with_settings" target="_self"&gt;sharing_create_shared_link_with_settings&lt;/A&gt; as documented in &lt;A href="https://help.dropbox.com/files-folders/share/force-download" target="_self"&gt;this help article&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Alternatively, if you need direct links and the links don't need to be long-lived, you can just use&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.files_get_temporary_link" target="_self"&gt;files_get_temporary_link&lt;/A&gt; instead. That returns direct links that last four hours.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 18:14:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-insert-a-picture-from-the-application-on-the-site/m-p/379256#M21222</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-11-18T18:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert a picture from the application on the site?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-insert-a-picture-from-the-application-on-the-site/m-p/380022#M21235</link>
      <description>&lt;P&gt;Not. Too many restrictions and difficult to implement. I solved the problem by switching to another service. Thank you for your time.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 15:47:44 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-insert-a-picture-from-the-application-on-the-site/m-p/380022#M21235</guid>
      <dc:creator>Legalas61</dc:creator>
      <dc:date>2019-11-21T15:47:44Z</dc:date>
    </item>
  </channel>
</rss>

