Dropbox, K2 and IFTTT too


“It’s like a USB stick but on the Internet and you can access your files from anywhere” that is now someone first introduced Dropbox to me, and to be fair it’s exactly that, well it was then and now it has additional features but it’s pretty much the same and that isn’t a bad thing. So why am I talking about Dropbox?

It’s because K2 has a new broker coming out in 2016 and it’s all about Dropbox. Which is awesome as it allows K2 to interact with a dropbox account to be able to send and retrieve files. This has loads of benefits as it would allow customers to drop files into a folder or for them to retrieve documents very easily and to also access these files offline.

So this article is about exploring what we can do with the Dropbox broker, and to make it even more interesting I am also going to use some additional services like IFTTT.

So what is Dropbox?

Accessing files from cloud storage is common place now and the majority of us use cloud storage to save documents,photos etc.. I do, I rarely keep anything local on my laptop anymore as it means I can access it from any location and on any device. This is what Dropbox does it allows me to access my files from anywhere and on any device. I can even have a special folder on my laptop that I can use to sync certain files and folders with to my Dropbox Account.


Dropbox Broker

The K2 Dropbox broker is very easy to setup and hopefully a new way to make it easier for people to hook up to new services.  As there is no longer a need to use  the service object tester to tell K2 about Dropbox

Creating a Dropbox App

We need a Dropbox account which you can get for free from here

We also need to create a dropbox app in your drop box account, to do that follow these steps.

1.Log into https://www.dropbox.com/developers/apps

2.Click on ‘Create App’


We are now in the app creation page, here we can choose to create a widget for a website or whether we want to actually use the Dropbox’s web services.


3.Select ‘Dropbox API app’, now some additional options will appear. Now we to decide on how the app will interact with dropbox, whether it will self contained to it’s own files and folders it creates or whether it will have access to all the files and folders in the account and we also need to decide on what files the app will be able to see.


4.Select ‘No’  for ‘ Can your app be limited to it’s own folder’

5.Select ‘All file types’

6. importantly we need to give the app a name!!

7.Click on ‘Create app’

8.Now that the app has been created we can now get the ‘App Key’ and ‘App Secret’ which we will need later for the broker. In  the ‘OAuth 2’ section put in  the address of your K2  server OAuth token address.

It will be something like this https://k2.%5Bdomainname%5D/identity/token/oauth/2


Ok, so now we have a created a dropbox app, now we need to tell K2 about it.

Registering the Dropbox App with K2

1. Go the K2 Designer and expand ‘All Item’s

2. Expand ‘System’ –  ‘Management’ – ‘Features’ – ‘Dropbox’ – ‘Forms’

3. Run the ‘Dropbox.main’ form


The next stage is really simple, we need the keys that we copied from the Dropbox app we created.


1. Enter in a suitable name like ‘DropBox’

2. Enter  your ‘App Key’ into the ‘Client Id’ box

3. Enter your ‘App Secret’ into the ‘Client Secret’ box

4. Click on ‘OK’

K2 will then start creating the service instance to the your DropBox app and checking it can access the app and the correct keys have been given.


During the setup a popup message will , saying it going to redirect you to dropbox for authorisation.


Once you have logged in successfully it will redirect you back to K2 to tell you that it has been successful. It will then continue to create the dropbox smartobjects and add the smart wizards, so you can use it within the workflow designer.

5. Click on ‘Done’ and that’s it, we are now ready to build an app in K2 that can integrate with Dropbox.

The video below goes through above steps of creating the Dropbox App and connecting Dropbox to K2.

Exploring the Dropbox SmartObjects

So we have seen how to configure Dropbox and K2, but what can you do with the Dropbox SmartObjects?  Lets take a look at each one to see what they can do

By default we get the following SmartObjects

  • Folder
  • File
  • Items
  • Shared Link
  • Thumbnail Size
  • Thumbnail Format

The last two are just look up objects, so we will be leaving those two out.


Folder Dropbox SmartObject

The folder SmartObject allows K2 to manage the folders within the dropbox account. It allows K2 to do the following

  • Create a folder – both parent and child folders
  • Delete a folder
  • List all the folders at particular level
  • Move Folders around
  • Copy Folders
  • Search for folders for matching key words

There is no  integer Id field or GUID that is the primary key, but instead DropBox uses a path of where the folder is and this path string is also used  for all other Dropbox smartobjects where a single row is returned.

File  Dropbox SmartObject

The folder Smartobject allows K2 to manage the files within the root of the dropbox account but also it’s folders and subfolders.  The file Smartobject allows you to do the following

  • Upload a file
  • Load File , load the details about the file
  • Load File without Content – loads the details about the file, but not content.
  • Restore, this restores a document from a previous version
  • Move, moves a file from one folder to another
  • List,  lists all the files in a given location
  • Search
  • List Revisions, show all the revisions for a given file
  • Delete, deletes a file


Item Dropbox SmartObject

This smartobject shows us all the details about a file or folder at a particular location. Item smartoject allows you to do the following operations

  • Load, shows the details about a particular folder or file
  • List, shows all files and folders at a location, also allows you to show deleted files
  • Search, allows you to search using a keyword to find any matching files or folders.item

Shared Link Dropbox Smartobject

This smartobject allows you to get a  shared link for a particular file or folder


Building a K2 app with Dropbox

Now that we have the smartobjects we can now start building a app that uses them. The app we are going to build is going to involve the following functionality from the smartobjects.

  • Creating a folder
  • Copying a file from SharePoint 2013 document library to Dropbox

I will also be using dynamics CRM to give the demo some context and it also wouldn’t be one of my demos without using some CRM data!!

So the App is about creating a depository for a customer. We create a depository folder for a customer and the folder name is based on the Account GUID.  Once we have the folder we can then select which documents from are Sharepoint library we want to move across into the repository for the customer to have access too. Once completed the customer will receive an email  or it could be an SMS message with a link to the content.

The video below goes through the steps of building the app.

To do the SMS integration you can see how it is setup from here

IFTTT (IF This Then That)

So what is IFTTT? is a cloud service that allows users to create chains of simple conditional statements, called “recipes”, which are triggered based on changes to other web services such as Gmail,Dropbox,Facebook, One drive.

Ok, but why use it with Dropbox and K2? Well partly because I can, but more importantly I think it demonstrates a good use of different services that can be used to build a really interesting application.

IFTTT, Dropbox and K2 Demo

In this demo i have created a recipe in IFTTT, that when i send an email with an attachment. It creates a folder in dropbox with the name of the subject of the email and then drops the attachment into that folder. It also strips the body of the email puts it into the a text file.  The subject happens to be the CRM Account number, so that we can see the documents within a K2 Smartform. In the case of the demo, when a creating a purchase order and we select an account a tab appears showing all the related documents from the corresponding folder.

Extending Dropbox with K2

Dropbox also comes with the ability to support web hooks, so we could take this further and that every time there is change it could post response to the K2 server, which would then start a workflow. In the same way we can have a SMS message / sensor start a workflow.

IFTTT also has the ability to make and receive web requests using it’s Maker channel, which also opens up a whole range of integration possibilities and will be something I will exploring later on in the year.


The DropBox broker is a brilliant addition to ever increasing list of out of the box brokers that K2 comes with, as not only is DropBox a popular service to use, but it gives businesses another option in the way it can store and access documents and not just to rely on SharePoint Document libraries. The broker will be out in 2016 and I for one can’t wait to see what people will do with it. Especially when there is additional services like IFTTT that can integrate with DropBox and in turn K2.

3 thoughts on “Dropbox, K2 and IFTTT too

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s