<?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: Dropbox integration fails with console message: client.getAuthenticationUrl is not a function in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-integration-fails-with-console-message-client/m-p/518080#M25319</link>
    <description>&lt;P&gt;Thank you very much Greg, that worked perfectly! I've also taken your advice to specify the version in the code rather than sticking with the latest.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 May 2021 18:15:03 GMT</pubDate>
    <dc:creator>talandis</dc:creator>
    <dc:date>2021-05-04T18:15:03Z</dc:date>
    <item>
      <title>Dropbox integration fails with console message: client.getAuthenticationUrl is not a function</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-integration-fails-with-console-message-client/m-p/517995#M25317</link>
      <description>&lt;P&gt;My web application has been failing for an unknown amount of time and was only noticed recently. Current behavior is that it is supposed to open a new window and run the following code snippet in that window to connect to dropbox:&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;var baseaddress = $("#baseaddress").val();
client = new Dropbox.Dropbox({ clientId: dropBoxClientid });
var authUrl = client.getAuthenticationUrl("https://"+baseaddress+'/delivery/download/dropboxredirect.url');
window.location = authUrl;&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;However I am seeing a console error in the chrome browser dev tools saying:&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;Uncaught TypeError: client.getAuthenticationUrl is not a function&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When inspecting the client variable I do see it being populated and seemingly correctly too. It fetches Dropbox-sdk.min.js from unpkg.com &amp;gt; &lt;A href="mailto:dropbox@9.6.0/dist" target="_blank" rel="noopener"&gt;dropbox@9.6.0/dist&lt;/A&gt;&amp;nbsp;correctly which is where it is populating the client variable from. I see getAuthenticationUrl is in a json object in the pulled in JS, but is not a function. Is anyone able to help me figure out what needs to changed in the distro that caused this to no longer work? I was not the original developer who implemented this and I am not sure what version it last worked on unfortunately. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 18:33:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-integration-fails-with-console-message-client/m-p/517995#M25317</guid>
      <dc:creator>talandis</dc:creator>
      <dc:date>2021-05-04T18:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox integration fails with console message: client.getAuthenticationUrl is not a function</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-integration-fails-with-console-message-client/m-p/518074#M25318</link>
      <description>&lt;P&gt;The getAuthenticationUrl method was moved under 'auth' in a previous version. You can find an example of using it &lt;A href="https://github.com/dropbox/dropbox-sdk-js/blob/main/examples/javascript/auth/index.html#L90" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking at your code, you probably mean to do this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var baseaddress = $("#baseaddress").val();
client = new Dropbox.Dropbox({ clientId: dropBoxClientid });
var authUrl = client.auth.getAuthenticationUrl("https://"+baseaddress+'/delivery/download/dropboxredirect.url')
  .then((authUrl) =&amp;gt; {
    window.location = authUrl;
  })&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, it's unclear from your message if are you doing so, but we don't recommend always just importing the latest version of the library automatically. In order to avoid major version changes from breaking your app, you should instead import specific versions of the library.&lt;BR /&gt;&lt;BR /&gt;For instance, unpkg has information on specifying particular versions here: &lt;A href="https://unpkg.com/" target="_blank" rel="noopener noreferrer"&gt;https://unpkg.com/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;This is because the Dropbox API v2 JavaScript SDK follows "semantic versioning". That means that we will increase the major version number whenever there are breaking changes. In general, you should avoid automatically using the latest version, i.e., including any major version updates, as your code may break when a major update is released. You should only upgrade to the latest major version in your released app once you've had a chance to test it in your app and make any necessary changes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 18:12:36 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-integration-fails-with-console-message-client/m-p/518074#M25318</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-05-04T18:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox integration fails with console message: client.getAuthenticationUrl is not a function</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-integration-fails-with-console-message-client/m-p/518080#M25319</link>
      <description>&lt;P&gt;Thank you very much Greg, that worked perfectly! I've also taken your advice to specify the version in the code rather than sticking with the latest.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 18:15:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-integration-fails-with-console-message-client/m-p/518080#M25319</guid>
      <dc:creator>talandis</dc:creator>
      <dc:date>2021-05-04T18:15:03Z</dc:date>
    </item>
  </channel>
</rss>

