Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
PriyankaChak
Active Contributor

Introduction:


This blog post shows the steps to connect with Dropbox using Dropbox adapter in Cloud Integration.

Implementation Guide:


Configuration at Dropbox:



  1. Create an app at https://www.dropbox.com/developers/apps.

  2. In redirect URL, provide the CPI tenant redirect URL.The App will auto-generate App key and App secret. App key will be used as client key and App secret will be used as client secret at the CPI side.

  3. Specify required permissions. For example, the required scope is files.content.write for file upload.


Configuration at CPI:


Step 1:


Go to CPI tenant -> Security Material-> Create -> OAuth2 Authorization Code as below.


OAuth2 Authorization Code


 

Authorization URL: https://www.dropbox.com/oauth2/authorize?token_access_type=offline

As no scope is specified, the authorization page will request all scopes selected on the Permissions tab of the Dropbox App.

Click on 'Authorize'. After successful authorization, a message will appear like below.

Authorization was successful: Refresh Token was added to the OAuth2 Authorization Code Credential 'DropboxOAuth2'.

Step 2:


Design I-Flow as below.


IFlow


 

  1. Use Content modifier to set file properties.Message body is set as 'This is a sample file', i.e, the file content.

  2. Use groovy script to set the property for the file path.
    import com.sap.gateway.ip.core.customdev.util.Message;
    def Message processData(Message message) {
    //Properties
    def properties = message.getProperties();
    def folderPath = properties.get("folderPath");
    def fileCounter= properties.get("counter");
    def filenamePrefix = properties.get("filenamePrefix");
    def fileExtension = properties.get("fileExtension");
    def filePath = folderPath + filenamePrefix + '_'+ fileCounter+ fileExtension;
    message.setProperty("filePath",filePath);
    return message;
    }​


  3. Configure Dropbox receiver adapter to upload the file.


 

Step 3:


Deploy the I-flow and check the Dropbox folder.



TakeAway Points:



  1. To connect with Dropbox, use OAuth2 Authorization Code.

  2. On selection of Dropbox adapter, it will be imported and deployed automatically (supported for standard and premium edition).


Reference Links:



  1. SAP Help Portal

  2. Integration Adapters in SAP API Business Hub for SAP Integration Suite


  3. Dropbox for HTTP Developers



  4. SAP API Business Hub


Thank you for reading this blog post. Please feel free to share your feedback or thoughts or ask any questions in the Q&A tag below.

QA link

Regards,

Priyanka Chakraborti
8 Comments
Labels in this area