Built.io Blog

How To Automatically Forward A Cisco Tropo SMS To Cisco Spark Using Built.io Flow

,

Here’s a quick “how to” set up an integration between Cisco Tropo and Cisco Spark using Built.io Flow Enterprise. The following tutorial will show you how to automatically forward an incoming SMS from Cisco Tropo to Cisco Spark using a Spark Bot.

Assumptions

Before we get started, we've prepared a checklist of tools you need and the technical familiarity you should have in order to properly create this integration.

  • Have a Cisco Spark account.
  • Have a Built.io Flow account.
  • Know how to create a Cisco Spark Bot. For more information on creating a bot within the Cisco Spark platform, please read the Bots page on Spark for Developers.
  • Be familiar with creating a bot on the Built.io platform. For a walkthrough of how to create bots on Built.io using Cisco Spark, feel free to check out How To Build A Bot On Cisco Spark And Built.io Flow.
  • Be Familiar with creating a Cisco Tropo application using the Tropo WebAPI. For more information on how to do that, please visit the documentation site for the Tropo WebAPI.

Here’s a screenshot of the flow.

cisco-tropo-and-cisco-spark-flow.jpg

Building The Workflow

Here are the steps to build the workflow.

  1. Starting with a blank canvas, add the Return Data on Sync Webhook to your workflow and connect it to the Play activity and the Stop activity as it is connected in the screenshot above.
  2. Edit the settings for Return Data on Sync Webhook to include the following:
    • Set the Response Data to the following JSON code snippet:
    •  { 
           "tropo":[{"say":{"value":"Thanks for your message!"}}]
        }       
    • Make sure “Content Type” is set to application/json.
      setting-up-content-type.jpg
  3. Add the Post New Message activity from the Cisco Spark Bot service. Ensure it’s from the Cisco Spark Bot service if the text message is going to be delivered via a Bot in Cisco Spark.
  4. Edit the settings of the Play button and turn on the Webhook.
    edit-play-button-turn-on-webhooks.jpg
  5. Connect the Post New Message activity to the Play activity and the Stop activity as seen in the final screenshot above.
    • Choose your Cisco Spark Bot authentication in the Connect to Spark Bot section.
    • Select a Spark room to post the message to in the Room ID section.
    • Finally, set the section to the following code snippet:
    • {{$request.body.session.initialText}}
      
      set-the-message-section.jpg
  6. Edit the settings for the line connecting the Play activity to the Post New Message activity by clicking on the line and clicking on the Settings icon.
  7. edit-line-setting.jpg
  8. The last thing we need to do in setting up the workflow is to create a conditional that ensures a message is only posted to the Spark Room if there’s a message to post.
    • Add a new condition and set the Input to:
    • {{$request.body.session.initialText}} 
    • Change the test to say (Input) Is String.
    • input-is-string.jpg

Setting Up Your Cisco Tropo Application

Here are the steps to set up your Tropo app.

  1. Create a new Cisco Tropo application.
  2. Choose a name for your new application (any name will do as long as it’s unique).
  3. Copy the Webhook URL from the workflow you created. You can get that URL from the settings in the Play activity.
    copy-the-webhook.jpg
  4. Back in Cisco Tropo, set the Type of Application to Web (HTTP) API, and in the following text box, paste the Webhook URL.
  5. Finally, make sure to choose a phone number.
    pick-a-phone-number.jpg

Popular Posts

Subscribe to our blog