<?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: JavaScript - I can't get shared_link_already_exists.metadata in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/JavaScript-I-can-t-get-shared-link-already-exists-metadata/m-p/663954#M30098</link>
    <description>&lt;P&gt;The shared_link_already_exists error is not guaranteed to contain the metadata of the existing link, so you do need to have sharingListSharedLinks implemented for when the existing link is not returned. The shared_link_already_exists error may not the contain the metadata of the existing link if the requested settings do not match the settings of the existing link, for instance. Note that the existing link returned by sharingListSharedLinks may not have the same settings that you requested, so be sure to check that as needed.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2023 13:49:34 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2023-02-28T13:49:34Z</dc:date>
    <item>
      <title>JavaScript - I can't get shared_link_already_exists.metadata</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/JavaScript-I-can-t-get-shared-link-already-exists-metadata/m-p/663881#M30096</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want to create a shared link or get a shared link if it already exists with JavaScript.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the shared link already exists, returned error has only '.tag'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;error: {
    error_summary: 'shared_link_already_exists/..',
    error: { '.tag': 'shared_link_already_exists' }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I have no choice to use &lt;EM&gt;sharingListSharedLinks&lt;/EM&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;await dbx.sharingCreateSharedLinkWithSettings({
    path: fileId,
    settings: {
      access: 'viewer',
      audience: 'team'
    }
  }).then(res =&amp;gt; {
    console.log(res.result.url);
  }).catch(async e =&amp;gt;{
    if(e.error.error['.tag'] === 'shared_link_already_exists'){
      console.log(e.error.error.shared_link_already_exists.metadata.url); // undefined
      await dbx.sharingListSharedLinks({
        path: fileId
      }).then((res) =&amp;gt; {
        console.log(res.result.links[0].url);
      }).catch((e) =&amp;gt; {    
      })
    }else{
    }
  })
})&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in API Explorer, error has metadata.url certainly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please tell me what caused this?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 10:31:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/JavaScript-I-can-t-get-shared-link-already-exists-metadata/m-p/663881#M30096</guid>
      <dc:creator>rweckey</dc:creator>
      <dc:date>2023-02-28T10:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript - I can't get shared_link_already_exists.metadata</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/JavaScript-I-can-t-get-shared-link-already-exists-metadata/m-p/663954#M30098</link>
      <description>&lt;P&gt;The shared_link_already_exists error is not guaranteed to contain the metadata of the existing link, so you do need to have sharingListSharedLinks implemented for when the existing link is not returned. The shared_link_already_exists error may not the contain the metadata of the existing link if the requested settings do not match the settings of the existing link, for instance. Note that the existing link returned by sharingListSharedLinks may not have the same settings that you requested, so be sure to check that as needed.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 13:49:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/JavaScript-I-can-t-get-shared-link-already-exists-metadata/m-p/663954#M30098</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-02-28T13:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript - I can't get shared_link_already_exists.metadata</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/JavaScript-I-can-t-get-shared-link-already-exists-metadata/m-p/663957#M30099</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1626570"&gt;@rweckey&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You're hitting in painful place of Dropbox API documentation - partial documenting. It's mentioned that "shared_link_already_exists" is optional field of the union, but no anything about what this depends on - that would let probability control. When exists, you can get the metadata, otherwise, as you have done, use link enumerations - least a bit optimization.&lt;/P&gt;&lt;P&gt;Let's hope the documentation will get improved.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 13:55:44 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/JavaScript-I-can-t-get-shared-link-already-exists-metadata/m-p/663957#M30099</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-02-28T13:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: JavaScript - I can't get shared_link_already_exists.metadata</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/JavaScript-I-can-t-get-shared-link-already-exists-metadata/m-p/664163#M30100</link>
      <description>&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The documentation states that &lt;EM&gt;shared_link_already_exists&lt;/EM&gt; is optional, but I could not determine if this behavior is a feature or a bug.&lt;/P&gt;&lt;P&gt;It appears that "metadata" is not returned when the parameter "audience" is set.&lt;BR /&gt;I confirmed the same behavior in API Explorer. Sorry for the lack of confirmation.&lt;/P&gt;&lt;P&gt;I also understood that I must use &lt;EM&gt;sharingListSharedLinks&lt;/EM&gt; and check the link setting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be nice to have better documentation.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 01:01:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/JavaScript-I-can-t-get-shared-link-already-exists-metadata/m-p/664163#M30100</guid>
      <dc:creator>rweckey</dc:creator>
      <dc:date>2023-03-01T01:01:14Z</dc:date>
    </item>
  </channel>
</rss>

