My previous post described how to integrate the Slack messaging app into your API Science monitoring work flow. I created a Slack channel to receive API Science alerts, added the channel to my API Science Contact Book, and configured my “br Tokyo” monitor to send an alert to the Slack channel whenever an API check fails.
Here’s an example of what appears in the Slack channel when the monitor check fails (see the last message, titled “Incoming-webhook”):
Clicking on the “View more details” link brings you to the details page for the check that failed.
Zapier is a platform that enables users to create interfaces between different applications. For example, one popular “zap” (Zapier’s nickname for the interfaces) creates new Trello cards from new Gmail emails. Zapier currently interfaces with more than 500 apps. Since Slack is among these apps, and Zapier’s interface with Slack includes monitoring channels for new messages, the Zapier infrastructure can be used to extend the reach of our API Science alerts to hundreds of apps and sites. So, no matter where your API monitoring team members are at the moment, if they’re connected to social media your alerts will find them.
In this post, I’ll show how to communicate API Science alerts received by Slack to Facebook using Zapier.
First, create a Zapier account, then click “MAKE A ZAP!” at the top of the page to enter the Zapier editor:
Note that for each app that will be part of your zap, you’ll have to provide Zapier with your login information and whatever other information is required to execute the actions your zap will perform. These steps are not included in the discussion below.
The first step is to name your zap and configure the trigger that invokes the zap:
Here, I’ve named my zap “Lyra Monitors” and I’ve selected the zap to be triggered whenever a new message is posted to a specific Slack channel. Clicking “Save + Continue” provides an opportunity to test the connection between Zapier and Slack. Run the test and click “Save + Continue” to select the Slack channel that will trigger the zap:
Here, I’ve selected the “acme_api_monitoring” channel that I created in my last post to receive API Science alerts. Clicking continue provides an option to test the trigger:
If all is configured correctly, Zapier will detect the message, and you’ll move on to configuring your zap’s action.
When my zap is triggered, I want a message to be posted to my Facebook account. Zapier provides multiple interfaces to Facebook, including posting to your timeline and posting to one of your pages. Here, I’ve chosen the latter:
When you click “Save + Continue” you’ll have to provide Zapier with the relevant information about your Facebook account (unless you’ve done this previously). Again, the zap editor provides an opportunity to test the connection with your Facebook account:
Click “Save + Continue” to select the Facebook page that will receive your zap’s posts, and enter the text that will be posted. You can also add a picture, specify a link to be included in the post, add descriptive material, etc.
Clicking “Continue” at the bottom right of the page brings you to a summary page that lets you test the page post configuration:
If the test is successful, you’ll see a new post on your Facebook page, published by Zapier:
Return to Zapier, and click “Finish” to complete your zap. The next Zapier page lets you activate your zap, which then shows up on your Zapier Dashboard:
With the zap activated, every time an API Science monitor sends an alert to Slack, a new post will be created on my Facebook page.