DropBox

DropBox


1. Create a DropBox Account

If you don't already have one, visit the DropBox website (https://www.dropbox.com) to create a DropBox account.

2.  Create a DropBox App


  • Select “Scoped access” in Choose an API





  • Choose “App folder” in type of App and set a name for your App




Your Dropbox app for getting data from ScrapeHero has been successfully created. You can access your created apps from the app console: https://www.dropbox.com/developers/apps/

3.  Set App permissions

  • Open you app from App console and go to permissions

  • Enable all 4 permissions in the Files and folders section and click submit


4.  Generate an Authorization code

  • Goto ‘settings’ and find the App key


  • Authorization code can be generated by opening the below URL.


https://www.dropbox.com/oauth2/authorize?client_id=<APP_KEY>&token_access_type=offline&response_type=code


Replace <APP_KEY> with your Dropbox app key



  • Click on ‘Continue’


  • Click on ‘Allow’



  • Authorisation code will get generated as below

 

5.  Generate a Refresh Token

Please copy the authorization code and use it to send the provided cURL POST request below in order to generate a refresh token for the Dropbox app.


curl https://api.dropbox.com/oauth2/token \
-d code=AUTHORIZATIONCODEHERE \
-d grant_type=authorization_code \
-u APPKEYHERE:APPSECRETHERE​



For AUTHORIZATIONCODEHERE, use the code obtained in step 3

APPKEY and APPSECRET can be obtained from settings section of app



You will get a response like below,


{

    "access_token": "sl.ByhMVNG3XkXEMapmCN4lU5KSfxUNTb62QuTREtnWXHyRNM1dzLSGwmil5EFJQEBhnLdOv",

    "token_type": "bearer",

    "expires_in": 14400,

    "refresh_token": "JdBkMuDBOywAAAAAAAAAAW082__gXOZjhjN_LImS97gkbZe",

    "scope": "account_info.read files.content.read files.content.write files.metadata.read files.metadata.write",

    "uid": "117779",

    "account_id": "dbid:AADl0eRklSeWO2UNqvM"

}



Please share the refresh_token”, “App key, and App secret with us to upload data to your DropBox account.


Note: If you encounter any other invalid responses such as an expired code, please proceed to generate a new authorization code (step 3) and then retry step 4 with the newly generated authorization code.