Upload files in Dropbox Using Mule 4 Dropbox Connector
In this tutorial we will demonstrate how can we upload files in dropbox using Mule 4 Dropbox connector
To upload the files first we need to create an account in dropbox if we don’t have any existing account and create app in dropbox, see below
Create Dropbox Account
Go to https://www.dropbox.com/login
Create new account or sign in using existing account
Once the account is created, open the below url to create app
https://www.dropbox.com/developers/apps
Click on Create app
- Select dropbox api
- Select Full Dropbox Access to all files and folders in a user’s Dropbox.
- Give the name of your app
App is created successfully
Click on generate access token and copy the token to use further
Create application in anypoint studio to upload files
Create a sample project in anypoint studio and configure the listener to trigger the request
Add the module for dropbox connector in anypoint studio
Drag and drop the Upload Files dropbox connector operation from mule palette and configure the connection
Copy the access token generated above and provide the app name created
Convert the json payload to CSV
%dw 2.0 output application/csv --- payload
Provide the File Content as Payload and path as /mulesoft/employee.csv ( File will be created under mulesoft folder)
Set the payload as File Uploaded Successfully In Dropbox
Trigger the request from soapui
See below csv file has uploaded successfully
Sample application: uploadfiletodropbox sample application
Soapui project: dropbox-soapui-project.xml