Mule Integration with Dropbox

Post on 07-Jan-2017

230 views 0 download

Transcript of Mule Integration with Dropbox

Integrate MULE ESB with Dropbox

By Ramakrishna Narkedamilli

Overview:

MuleSoft is a popular ESB technology to integrate various on-premise and cloud applications for data exchange. Dropbox is a cloud storage for personal and business people. Provides client software for many operating systems to sync with Dropbox account data. The Mule Dropbox connector allows applications to interact with Dropbox API to perform various actions.

In this presentation will going to see how to Integrate Mule ESB with Dropbox account to perform Authorization and create folder actions using Mule ESB Anypoint Dropbox connector.

Prerequisites:

Dropbox Developer account. Dropbox app key and app secret values Mule studio with runtime version 3.4+ Mule Dropbox connector.

Dropbox Developer Account Setup:

For this sample purpose, we need Dropbox account. We can sign up for free at https://dropbox.box.com/

Once account creation done, open the link and click on Create app button https://www.dropbox.com/developers/apps

Provide the appropriate values like below and click on Create app button available at bottom.

Finally note down the APP key and APP secret values and add the Oauth2 call back URL.

MULE ESB Flows for Dropbox Integration

The below Mule application is used to create folder under Dropbox account after performing authorization action using Mule Anypoint Dropbox connector.

Steps to be followed for integrating ‘Dropbox’ with MuleSoft Applications:

Install the Dropbox Connector in Anypoint Studio http://repository.mulesoft.org/connectors/releases/3.5

Create a new Anypoint Studio Project and Flow to create new folder.

Configure the Dropbox global element in global elements section by providing the App key and App secret values and setup the oauth callback for authorization.

In the flow first add HTTP inbound endpoint to trigger the service.

Add Dropbox endpoints in the flow for authorization and folder creation referring to Dropbox global connector.

In the Second Dropbox endpoint for folder creation enter MEL expression #[message.inboundProperties.'http.query.params'.foldername] in path variable to create folder in the Dropbox account rootpath.

Now at this position we are integrated with Dropbox to perform actions.

Running and Testing the Application:

Right-click on the application Run Mule Application. Open the browser and hit the url http://localhost:8082?foldername=Mule_POC_Folder Service will take the control to Dropbox for authorization and grant the permission

(This below screen will appear if you already logged in authorize it will ask you to login first then below screen will appear).

On the successful authorization, folder will be created under Dropbox account and response will be returned to browser in case of no errors

Folder creation Under Dropbox

Open the Dropbox account, now you’re able to see new folder “Mule_POC_Folder”

THANKS YOU By Ramakrishna Narkedamilli