Connecting to Dropbox from App Connect Enterprise as a Service

You can connect to Dropbox either from the App Connect Designer Connect > Applications and APIs page (previously the Catalog page), or when you add an app to a flow.

To connect App Connect to Dropbox, select your preferred authorization method:
  • OAUTH 2.0 AUTH CODE
  • BASIC OAUTH

For OAUTH 2.0 AUTH CODE, to connect App Connect to your Dropbox account, click Connect. App Connect connects to your Dropbox account automatically. You might be prompted to sign in if you are not already connected to Dropbox.

For BASIC OAUTH authorization method, enter the account information in the connection fields that are displayed (see the following table), and click Connect.

Table 1. Local connector fields
Field Description
Access token The long-lived or short-lived access token for your Dropbox application. Details about how to obtain this value are described below.
Refresh token The refresh token that is generated along with the short-lived access token. You can obtain the short-lived and refresh tokens pair by performing the Dropbox OAuth 2.0 authorization code flow steps as described in the following steps. A refresh token is generated to revalidate the expired short-lived access token.
Client ID The app key found in the settings page of your Dropbox application. This property is only required if you have provided the short-lived access token.
Client secret The app secret found in the settings page of your Dropbox application. This property is only required if you have provided the short-lived access token.
    1. Sign up for a Dropbox developer account in the Drop box DBX platform.
    2. Click Create apps and complete the form to create an app. The Settings page of the app is displayed.
    3. In the OAuth 2 section, use the Access token expiration menu to select No expiration.
    4. Click Generate.
      Button to generate a long-lived access token
    5. The long-lived access token is displayed and ready for you to use to access your Dropbox account.
    1. Sign up for a Dropbox developer account in the Drop box DBX platform.
    2. Click Create apps and complete the form to create an app. The Settings page of the app is displayed.
    3. In the Status column of the Settings page, the App key and App secret are displayed. The App key is the value that you need for the client ID and the App secret is the value that you need for the client secret in App Connect.
      How to find the application client ID and client secret
    4. In the OAuth 2 section, add a redirect URI. For the purposes of this example, we'll use https://www.google.com/.
      Adding a redirect URI
    5. Click Add.
    6. In the same section, use the Access token expiration menu to select Short-lived.
    7. To generate the access and refresh token pair, you need to generate an authorization code. To do this, construct a Dropbox authorization URL with your application’s client ID and redirect URI (if applicable) in the following format.
      https://www.dropbox.com/oauth2/authorize?client_id=MY_CLIENT_ID&redirect_uri=MY_REDIRECT_URI&response_type=code&token_access_type=offline
      For example:
      https://www.dropbox.com/oauth2/authorize?client_id=rt5alrhd93n7ga3&redirect_uri=https://www.google.com/&response_type=code&token_access_type=offline
      Note: Ensure that the redirect URI matches the exact format that you specified in Step 4. For more information about the Dropbox authorization URL, see https://www.dropbox.com/lp/developers/reference/oauth-guide.
    8. Paste the authentication URL into a browser window and click Enter to generate the authorization code. The code is located in the query string, as displayed in the following image.
      Authorization URL response with the authorization code
    9. Use an application such as IBM API Connect Test and Monitor or Postman to make a POST OAuth2 token call.
      POST https://api.dropbox.com/1/oauth2/token 
      Update the parameters as specified in the following table:
      Table 2.
      Key Value
      grant_type authorization_code
      client_id The app key retrieved in Step 3
      client_secret The app secret retrieved in Step 3
      redirect_uri The redirect URI that you specified in Step 4
      code The authorization code retrieved in Step 8
      For example:
      POST OAUth2 token call
    10. Click Send. The response is displayed with your access token and refresh token.
      Response displaying your access and refresh token
      Note: The refresh token does not expire unless you revoke the short-lived access token.

To connect App Connect to your Dropbox account, click Connect. App Connect connects to your Dropbox account automatically. You might be prompted to sign in if you are not already connected to Dropbox. This creates an account in App Connect. For more information, see Managing accounts.

Tip:

Before you use the account that is created in App Connect in a flow, rename the account to something meaningful that helps you to identify it. To rename the account on the Applications and APIs page, select the account, open its options menu (⋮), then click Rename Account.