Prepare Dropbox connector
The Dropbox connector retrieves information about users and user activity.
In Dropbox developers console, you are required to create an app and give permissions to it, request a Refresh token, copy App key, App secret, and enter them in Settings when adding the connector.
Prerequisites
A Dropbox Business admin account is required to connect to the Dropbox API.
Procedure
Sign in to the Dropbox developers console with an admin account: https://www.dropbox.com/developers/apps
Create an app.
In My apps, select Create app.
In the Create a new app on the DBX Platform view, in Choose an API, select Scooped access.
In Choose the type of access you need, select Full Dropbox – Access to all files and folders in a user's Dropbox.
In Name your app, enter a unique name for your app.
Select Create app.
Set permissions for your app.
Go to the Permissions tab and select the following options, if not already selected:
account_info.read
team_info.read
members.read
sessions.list
Select Submit.
Tip
There may be a bug in Dropbox, so that you first have to select the three last permissions, then clear account_info.read, and then submit. The account_info.read gets automatically selected again when you refresh the page, and the permissions should work.
On the Settings tab of your app, copy and save the values in App key and App secret.
They are used in the following steps, and when adding the connector in Step 8.
Generate an access code with OAuth2.
In the browser where you are signed in to Dropbox developer console, paste the URL below and replace
<APP_KEY>
with the copied App key value.https://www.dropbox.com/oauth2/authorize?client_id=<APP_KEY>&response_type=code&token_access_type=offline
Press Enter.
An OAuth2 process starts.
Select Continue, and then Allow.
Copy the generated access code and save it for use in Step 7.a.
Encode the App key and App secret into Base64 string format.
Depending on your platform, do one of the following:
In Windows, using Microsoft PowerShell, in a command line, run the following command:
Replace
<APP_KEY>
and<APP_SECRET>
with the saved App key and App secret values respectively.[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes('<APP_KEY>:<APP_SECRET>'))
In macOS or Unix, in a command line, run the following command:
Replace
<APP_KEY>
and<APP_SECRET>
with the saved App key and App secret values respectively.echo -n "<APP_KEY>:<APP_SECRET>" | base64
Copy and save the returned, encoded value for use in Step 7.a.
Request a refresh token using the encoded value and the access code.
Depending on your platform, do one of the following:
In Windows, using Microsoft PowerShell, in a command line, run the following commands separately:
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/x-www-form-urlencoded")
Replace
<BASE64>
with the encoded value from Step 6.b.$headers.Add("Authorization", "Basic <BASE64>")
Replace
<CODE>
with the access code saved in Step 6.a.$body = "code=<CODE>&grant_type=authorization_code"
$response = Invoke-RestMethod 'https://api.dropboxapi.com/oauth2/token' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
In macOS or Unix, in a command line, run the following command:
Replace
<BASE64>
with the encoded value saved in Step 6.b.Replace
<CODE>
with the access code saved in in Step 5.d.$ curl --request POST 'https://api.dropboxapi.com/oauth2/token' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --header 'Authorization: Basic <BASE64>' \ --data-urlencode 'code=<CODE>' \ --data-urlencode 'grant_type=authorization_code'
Copy and save the refresh token value in the returned json response. It is used when adding the connector in Step 8.
When adding the connector, in Settings, enter the saved values in App key, App secret, and Refresh token.
After completing this task, follow the general procedure to Add connectors.
The connector makes API calls to the vendor to retrieve data.