Dropbox Drop-ins Chooser integration with website
In this post we will see how to integrate Dorpbox into any website. Here I am using readymade dropbox plugin called Drop-ins also called Chooser. It is very easy to integrate, here are the steps.
Like any other API we need to create a API key first, so we will go to : Dropbox Developer
You have to Signup and signin first obviously. Select Drop-ins and fill name for the app as shown in screenshot.
On setting tab fill the domain as somedomain.com and click Add button For testing you can ad localhost as well. Here itself you will see App key for your App.
A demo code is given below, just replace my data-app-key with your API key and run the file. IMPORTANT NOTE: Drop-ins will work properly in SSL environment (https://)
<title>Dropbox Dropins integration basic example - devzone.co.in</title>
<!-- Replace data-app-key with yours -->
// add an event listener to a Chooser button
alert("Here's the chosen file: " + e.files.link)
window.location.href = 'e.files.link';
<input type="dropbox-chooser" name="selected-file" id="db-chooser"/>
And thats it!
For more visit official docs: Dropbox Developers
Soon we will back with more custom dropbox app..