This post is the second in a series by Stamplay CEO Giuliano Iacobelli, building applications with Box Platform APIs and their low-code tools. The last post showed how to use Box as a digital asset management solution, leveraging the Clarifai computer vision API to automatically analyze, tag, and organize images uploaded into project folders in Box. This second post shows how to create a Box bot for Cisco Spark.
This post originally appeared on the Stamplay blog.
When you become addicted to a cloud storage solution like Box the amount of files stored there can be a lot. For this reason you really don’t want to leave your team collaboration tool every time you need to share a file with your team mates.
This Spark bot allows you to search by name any file in your Box account without leaving the chat.
Note: this blueprint will work on Box accounts at the Business+ level or higher, since it relies on direct download capability and metadata templates.
1. Create your Cisco Spark bot
Go to https://developer.ciscospark.com/apps.html and create a Bot.
Fill the basic info to create your bot (if you need a 512x512 icon you can use this one http://i.imgur.com/HQTF5FK.png)
Once the bot is created you’ll see an Access token, copy it and save it temporary somewhere.
2. Configuring the Blueprint
This app is available as a Blueprint, a pre-built template to help you get started with proven integration solutions. To get started click here or on the button below:
You’ll be prompted to pick a name for your project and then a wizard will start. After that Stamplay will prompt you to:
- provide Spark bot access token
- Connect your Box account
Once you have connected the two services click on Next.
Then you’ll be ask to provide the name of your bot. Here you need to type the name you gave your bot when you created it, the bot name precedes the @sparkbot.io part of its email address. (e.g the name for email@example.com is mybot)
adding the bot name
How to use it
Now you’re ready to leverage your bot in 1-to-1 conversations or invite him in Spark rooms for the benefit of your team. To search for a file you only need to tell him:
In the example below you can see how it is used in a private conversation. In a group the only difference is going to be that you need to mention the bot before sending him the actual command.
How it works
This Spark bot is ran by a single Flow that capture any incoming message, checks if it contains the GETFILE command with a conditional step and, if so, it strips away the file name using the Code Block, search for it on Box and eventually returns the search result back on Spark.
The Flow running the spark bot
Box Find File action currently searches across all files (by name or content) starting from the user’s root folder on Box.
If you want to refine your searches only inside a specific Box folder you can do that by adding the Id of the folder in the Ancestor Folder IDs configuration field for the Find File action.
Scoping file search in a specific Box folder
You’re good to go now. Just start uploading pictures in the upload folder and you’ll start seeing your content organized.
At Stamplay we make it easy for people to automate processes and create high value integrations by tying together APIs. If you need help to connect your apps or have an API that you want to make easy to connect with tweet us at @stamplay and/or drop us a mail at firstname.lastname@example.org.