Downloading a file from IBM Cloud Object Storage to a Dropbox folder
Learn how to use IBM® App Connect on IBM Cloud® to create an event-driven flow such that when a new contact is created in Salesforce, a ‘Getting Started’ document is automatically downloaded from IBM Cloud Object Storage and then sent to a specific folder in Dropbox.
IBM's Cloud Object Storage (COS) S3 is ideal for holding large amounts of colder production data, such as backups and archives, and very large individual files, such as video files, image files, and genomic data. IBM's Cloud Object Storage S3 is a reliable, durable, and resilient object storage.
Additional reference:
Scenario
For this scenario, you are using Salesforce to manage customers and use IBM Cloud Storage to store some related documents. You also use Dropbox to share files in folders specific to users. When a new contact is created, you want to create a folder on your Dropbox and as a first step, send a ‘Getting Started’ document to this contact. The ‘Getting Started’ manual is a PDF file stored in your IBM Cloud Object Storage account.

(Click image to view full size.)
First, find or create everything you need:
- Obtain account details for connecting App Connect to your applications (If you haven't already
connected App Connect to your applications.):
- For Salesforce, you need user id and password credentials to connect. If you want to create a free Salesforce account to test out App Connect, make sure that you create a Developer account rather than a Trial account. For more information, see How to use IBM App Connect with Salesforce
- To connect to an IBM Cloud Object Storage account, you need the following values that can get from the "Endpoint" and "Service Credentials" pages in the side navigation of your IBM Cloud Object Storage dashboard:
- Endpoint URL: COS Endpoint / PUBLIC or PRIVATE URL value for your region; for example, s3.us.cloud-object-storage.appdomain.cloud (PUBLIC for us-geo region)
- Secret Access Key: COS Service credentials / View credential (with HMAC) / cos_hmac_keys/ secret_access_key
- Access Key ID: COS Service credentials / View credential (with HMAC) / cos_hmac_keys / access_key_id
- Region: COS Endpoint / Select Location value; for example, us-geo
Note: To get a Secret Access key and Access Key ID, you need to have a credential created with the option to generate HMAC credentials. (When adding a new credential, specify{"HMAC":true}
in the field "Add Inline Configuration Parameters (Optional):". For more information, see doc link after examples).For example:
Figure 2. Credential with HMAC keys on IBM Cloud Object Storage console (Click image to view full size.)
In App Connect, when creating a connection to IBM Cloud Object Storage:- Endpoint URL:
s3.us.cloud-object-storage.appdomain.cloud
- Secret Access Key:
12e3f4b56b780503172f70fdb2d1605a5dcfaf834d896c42
- Access Key ID:
1234eeaa5ce67e2a89f52bc33f6a172d
- Region:
us-geo
For information about determining these values and about generating HMAC credentials, see "Service credentials" in IBM Cloud Docs / Cloud Object Storage.
- You can create a connection to Dropbox either using a Dropbox user ID and password or using a Google account.
Next, create your flow:
Using the IBM App Connect Designer authoring experience, you can create your flow from a template, or from scratch if you want to explore the steps taken to create a flow.
Complete the following steps in App Connect Designer:
- From the Dashboard, click
Complete the following steps. As you progress, App Connect automatically saves your changes. If you navigate away from the flow at any stage, the flow is saved as a draft flow that you can complete at another time.
- Enter a name that identifies the purpose of your flow; for example: Share Document with Salesforce Contact
- Select as the event that is to trigger the flow.
- Click the (+) and then scroll down to IBM Cloud Object Storage S3.
- Select
Figure 3. IBM Cloud Object Storage / Download object action (Click image to view full size.)
as the action that App Connect should use to download the ‘Getting
Started’ document. - If you have not connected App Connect to IBM Cloud Object Storage, click Connect and then
complete and submit the request using the account details that you obtained above.
Figure 4. Specify details to connect to IBM Cloud Object Storage S3 (Click image to view full size.)
- Select the ‘Bucket’ where your document is stored on IBM Cloud Storage.
Figure 5. Download the object from IBM Cloud Object Storage (Click image to view full size.)
- Select the Type of file as ‘binary’ since you are downloading a PDF document
- Set the Object name as the name of your ‘Getting_Started’ manual.
- For the next node, click the (+) after the IBM Cloud Object Storage S3
node and scroll down to the Dropbox.
You next create a folder for the new Salesforce contact.
- Select
Figure 6. Create a folder on Dropbox (Click image to view full size.)
as the action that App Connect should use to create a folder. - Set the ‘Path’ field to uniquely identify a folder for the contact. As an example, I am creating a folder with the contact's first and last name separated by an underscore. The value is mapped from the Salesforce node's 'New contact' field into the 'Path' field of Dropbox node's Create folder action
- Next, create the ‘Getting Started’ manual that was downloaded from IBM Cloud Object Storage S3 in this folder on Dropbox
- Click the (+) after the Dropbox Create folder node, scroll down and select Dropbox.
- This time, select Dropbox > Create file as the action that App Connect should use to create a file.
- Set the following values for the fields in your Dropbox > Create file
- For the ‘Path’, map the first and last name, separated by an underscore, to the Salesforce node's New contact
- The ‘File content’ is mapped to the Object content from the IBM Cloud Object Storage S3 nodes's Download object.
- Set ‘Auto rename’ to false since this is the first time the file is being created.
Set ‘Mute’ to false.
- Set the ‘FileName’ as the name of your ‘Getting Started’ manual. In this example, I have used the name ‘Getting_Started.pdf’
- Set ‘Is text’ to false, since this is a pdf document that is getting uploaded.
Figure 7. Create a file in the folder created on Dropbox (Click image to view full size.)
- Click Start flow on the toolbar, then click
Dashboard to exit the flow. Your flow is displayed on your Dashboard and is
listening for your event ; the addition of a new contact in Salesforce.
Figure 8. The flow tile on the Dashboard, showing that the flow is running and listening for events (Click image to view full size.)
Finally, test your flow:
- Log in to Salesforce using the account that you configured in App Connect.
- Create a new Salesforce contact and save the contact.
Figure 9. Creating a new contact in Salesforce (Click image to view full size.)
- After a short while, check your Dropbox for a new folder and document.
Figure 10. Document created in the folder on Dropbox (Click image to view full size.)
- Examine the App Connect Dashboard. If the flow ran successfully, the flow tile shows a green tick

(Click image to view full size.)
Conclusion
Congratulations, you have created a flow that is triggered when a new contact is added to Salesforce, it downloads a document from IBM Cloud Object Storage S3, creates a folder on Dropbox and places the downloaded document in the folder.