You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
talandis
4 years agoNew member | Level 2
Dropbox integration fails with console message: client.getAuthenticationUrl is not a function
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 tha...
- 4 years ago
The getAuthenticationUrl method was moved under 'auth' in a previous version. You can find an example of using it here.
Looking at your code, you probably mean to do this:
var baseaddress = $("#baseaddress").val(); client = new Dropbox.Dropbox({ clientId: dropBoxClientid }); var authUrl = client.auth.getAuthenticationUrl("https://"+baseaddress+'/delivery/download/dropboxredirect.url') .then((authUrl) => { window.location = authUrl; })
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.
For instance, unpkg has information on specifying particular versions here: https://unpkg.com/
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.Hope this helps!
Greg-DB
Dropbox Staff
The getAuthenticationUrl method was moved under 'auth' in a previous version. You can find an example of using it here.
Looking at your code, you probably mean to do this:
var baseaddress = $("#baseaddress").val();
client = new Dropbox.Dropbox({ clientId: dropBoxClientid });
var authUrl = client.auth.getAuthenticationUrl("https://"+baseaddress+'/delivery/download/dropboxredirect.url')
.then((authUrl) => {
window.location = authUrl;
})
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.
For instance, unpkg has information on specifying particular versions here: https://unpkg.com/
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.
Hope this helps!
talandis
4 years agoNew member | Level 2
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.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,915 PostsLatest Activity: 2 days agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!