Trigger Anything with Zapier

Set up a Xively trigger to activate your favorite web services, using Zapier

Introduction

Zapier is a service that lets you automate tasks between web applications. Connecting a Xively trigger to Zapier lets your Xively feeds send a tweet with Twitter, activate a call or SMS with Twilio, or influence any number of web apps - see Zapier’s directory for more.

This tutorial will help you connect Xively triggers and Zapier. Xively triggers can be fired when the value of a channel matches certain criteria. For example, if a channel goes above or below a certain value, or freezes for some time, or is updated, you can set a trigger to fire. A trigger fire takes the form of an HTTP “Post”, which is what Zapier’s free accounts accept - perfect! If you don’t know about HTTP Posts, that’s no problem - read on to find out how to tie triggers to the services Zapier exposes …

Setup a Zapier Zap to Act when Your Trigger Fires

  1. Go to www.zapier.com and sign in. (Create a free account if you don’t have one)
  2. Click the button to
  3. Make the Trigger Service (left side of zap) a ‘Web Hook’ - then select ‘Catch Hook’
  4. Choose the ‘Action Service’ side of your Zap. This could be anything but an email is a good way to test things out.
  5. Click continue, you will be given a webhook URL. Copy this and keep it handy.
  6. Keep this tab open, but return to the Xively workbench. We’re going to come back here in a minute.

Setup a Xively Trigger to Activate Zapier

  1. Go to the Xively device that you would like to create a Trigger for
  2. On the Xively workbench, click
  3. Add the details of the trigger that will activate your Zapier action
  4. Enter the URL of the Zapier webhook as the HTTP POST URL. This will arrange for the Xively trigger to be sent to Zapier.
  5. The trigger is set up! Let’s go back to our Zapier tab.

Connecting Xively to Zap

  1. Go back to Zapier, click continue.
  2. There are options to filter the JSON coming from Xively. This can be very useful if you want to send the entire Xively Post. If you are just looking for a few data values, go to the next step.
  3. Next you fill in the details of the interaction you desire, this can vary greatly depending on what the other side of your Zap is. Some Zaps require additional setup, authorization, and/or API keys.

Any field which has a globe in the top right corner can be filled with parsed JSON values. Clicking the globe in the top right will open a list of parsed JSON keys. Selecting one of these keys will insert the value for that key at a specific place in the text box. This allows you to create rich messages and notifications with text and data.

Take this code and run!

Now that you have a Xively trigger activating a Zapier zap, try out a few new ones!

Or try building an entire network of devices with triggers – it’s a great way to quickly mock up advanced messaging and trigger capabilities in a finished product.