ABSYZ ABSYZ

  • Home

    Welcome to ABSYZ

  • About us

    Who We Are

  • Our Expertise

    What We Do

  • Our Approach

    How We Do It

  • Products

    What We Made

  • Industries

    Who We Do It For

  • Clients

    Whom We Did It For.

  • Article & Blogs

    What Experts Think

  • Careers

    Join The Team

  • Get In Touch

    Let’s Get Started

ABSYZ

Dropbox Integration with Salesforce

Home / Article & Blogs / Apex / Dropbox Integration with Salesforce

Dropbox Integration with Salesforce

By Souravmoy inApex, Integration, Salesforce

Hi All,

Today I will show you how to copy files to Dropbox from Salesforce using Dropbox integration.

You don’t need to buy costly AppExchange apps or services like Zapier to do this. We will show you how to do this with a simple Apex class.

First of all, we need is a Dropbox account and a Salesforce org with which we will integrate with.

If you don’t have a Dropbox account, you can get one at https://www.dropbox.com/. We have one already, so we won’t be signing up again.

Capture1
Dropbox SignUp page

Fill up the form, and you will get your Dropbox account.

Now, go to the developer section of Dropbox. To do so type https://www.dropbox.com/developers in the URL and press Enter. Here we will be creating a Dropbox app that will act as a listener between the Salesforce org and the Dropbox account.

Capture2
Dropbox developer page

Click on Create your app tab to start creating the app.

Screen Shot 2017-06-28 at 9.55.19 PM
Create app page in Dropbox

On the next page, select Dropbox API, and access as Full Dropbox. Give a name to your app and click on Create app button.

(Refer to the image below to create the app)

Screen Shot 2017-06-28 at 9.58.05 PM
App settings

After the app is created, there are a few more settings you need to do to proceed. Keep the App key and App secret handy. You have to update the Redirect URIs in the OAuth 2 section later on.

Screen Shot 2017-06-28 at 10.03.33 PM
App advanced settings

Now, create the Visualforce page from where you will be uploading the files to Dropbox. Set the URL of the visual force page in the Redirect URIs of the Dropbox app. (image below)

Screen Shot 2017-07-01 at 9.56.40 PM
Update the Redirect URI with vf page URL

Click the Dropbox login button to log in to Dropbox and authorise it to upload files to your Dropbox account.

Screen Shot 2017-07-01 at 10.08.24 PM
Click Dropbox login

Login to your Dropbox account to give authorisation.

Screen Shot 2017-07-01 at 10.10.45 PM
Login to Dropbox

Now you can see the email id of the connected Dropbox account and a file uploaded.

Select a file and Upload to Dropbox.

Screen Shot 2017-07-01 at 10.16.54 PM
Select file and Upload

[code language=”java”]

public DropboxUploadController() {
connected = false;
success = false;
apiKey = ”; // this is your dropbox apikey
apiSecret = ”; // this is your dropbox api secret
redirectURI = ‘https://souravmoy-dev-ed–c.ap2.visual.force.com/apex/DropboxUpload’; // url of the vf page in which the dropbox login is done
Dropbox_Account_endpoint = ‘https://api.dropboxapi.com/1/account/info’;
Dropbox_files_endpoint = ‘https://content.dropboxapi.com/1/files_put/auto/’;
Dropbox_OAuth_authorize = ‘https://www.dropbox.com/1/oauth2/authorize’;
Dropbox_OAuth_token = ‘https://api.dropboxapi.com/1/oauth2/token’;

code = ApexPages.currentPage().getParameters().get(‘code’);
if(code != null) {
connected = true;
authorizationCode = code;
getRefreshToken();
retrieveUserInfo();
}
}

[/code]

In lines 4, 5 write the App Key and App Secret of your Dropbox app.

References:

The code in GitHub.

Dropbox
48
Like this post
3 Posts
Souravmoy

Search Posts

Archives

Categories

Recent posts

Top 5 Factors to evaluate before choosing a Salesforce Integrator

Top 5 Factors to evaluate before choosing a Salesforce Integrator

Significance of UI/UX Design

Significance of UI/UX Design

Cyber-security in an uncertain world

Cyber-security in an uncertain world

The world of AR and VR

The world of AR and VR

The in-and-out of ML

The in-and-out of ML

  • Previous PostLogin to Salesforce from Facebook using Graph API
  • Next PostWorkAround for PDF Rendering in SF1

Related Posts

Cyber-security in an uncertain world
Apex

Cyber-security in an uncertain world

REST API call from Einstein Analytics Dashboard
Apex REST Salesforce Salesforce Einstein Wave Analytics

REST API call from Einstein Analytics Dashboard

Create/Update Salesforce Picklist definitions using metadata API
Integration Metadata API Salesforce

Create/Update Salesforce Picklist definitions using metadata API

1 Comment

  1. chezib
    Reply
    14 December 2017

    This is nice.
    Did you notice dropbox API v1 is not available anymore?…

    Reply

Leave a Reply (Cancel reply)

Your email address will not be published. Required fields are marked *

*
*

ABSYZ Logo
  • Home
  • About us
  • Article & Blogs
  • Careers
  • Get In Touch
  • Our Expertise
  • Our Approach
  • Products
  • Industries
  • Clients
  • White Papers

ABSYZ Software Consulting Pvt. Ltd.
USA: 49197 Wixom Tech Dr, Wixom, MI 48393, USA
M: +1.415.364.8055

India: 6th Floor, SS Techpark, PSR Prime, DLF Cyber City, Gachibowli, Hyderabad, Telangana – 500032
M: +91 79979 66174

Copyright ©2020 Absyz Inc. All Rights Reserved.

youngsoft
Copy