How to automagically upload photos, videos and other assets from Dropbox into Sitecore Content Hub

Sitecore Content Hub is a powerful SaaS platform for creating, managing your assets and content. Dropbox is also a Cloud SaaS product for managing your files but it does not provide the same set of capabilities as Content Hub does.

In this blog post, I will show you the steps to upload photos, videos or any other digital assets from Dropbox into Sitecore Content Hub.

In the traditional world, developer(s) would build an integration between these platforms using a programming language that they are familiar with. Though there are good reasons to still follow this approach, obviously it is time consuming and requires deployment and maintenance. As low to no code platforms taking the hot seat these days due to demand and speed, my colleague Tim Marsh (special thanks to him for bringing up this smart idea) and I wanted to experiment something with one of those no/low-code platform called "Sitecore Connect".

Sitecore Connent is another SaaS offering by Sitecore which has built-in connectors to other Sitecore products in the ecosystem like XP, XM, Content Hub, etc. but it also provides a whole gamut of connectors through Workato to well known third-party applications like Dropbox, OneDrive, Google Drive to name a few.

I'm going to assume you have access to a Dropbox folder (personal or business), a Content Hub sandbox and a Sitecore Connect instance.

Here are the steps:

  1. Open the Sitecore Connect instance in a browser and navigate to Projects
  2. Create a new project or go into your existing project if you have one already
  3. Create a connection to your Content Hub instance by clicking Create -> Connection

  4. Provide the instance URL, Client ID, secret, username and password from your Content Hub instance
  5. Create a connection to DropBox inside your project as in the screenshot below
  6. Next up, create a Recipe. Receipe is where you will build your business logic. I'll show you how it works in the following steps.
  7. The first step in the recipe is to setup a trigger for any files (be it photos, videos or any other assets) that is new or updated in Dropbox folder to notify Sitecore Connect.
  8. Steps 2 to 8 follow the Sitecore Content Hub upload process using its Rest APIs. You can find more information about Upload API here - https://doc.sitecore.com/ch/en/developers/40/cloud-dev/rest-api--upload-api-v2.html. Basically, it is a 3 step process:
    • Request an upload
      • Pay attention to the File name in the screenshot. Usually the file name in Dropbox also contains the folder name like /Folder Name/File Name. You need to strip out the folder name and go with just the file name
    • Download the file from Dropbox. 
      • This is a crucial step without which the actual file content won't be transferred to the asset in Content Hub
    • Perform the upload
      • Ensure that content-type is set to multipart/form-data
    • Finalize the upload
  9. Finally when the asset is uploaded into Content Hub, you will set the FinalLifeCycleStatusToAsset value to Approved
The whole setup from start to finish took few hours to complete including the learning curve of the tool.

As you can see, this brings so much power to Marketer's hands who want to build something quickly for their campaigns without relying much on the technical team.

I hope you enjoyed reading this blog post and learned something from it.




Comments