iHook

iHook

  • Blog
  • Docs
  • Dashboard

›Quick Start

Quick Start

  • Create your first task
  • Create your first receiver

Task Settings

  • HTTP Settings
  • Request Schedule

Task Notifications

  • Notification Overview
  • Source
  • Property / CSS Selector
  • Comparison
  • Message Template

Task History

  • Chart

Task Errors

  • Errors

Task Shortcuts

  • Keyboard Shortcuts

Receiver Variables

  • Receiver variables

Task Examples

  • Nintendo Switch availability monitor
  • Weather monitor
  • Insider trading monitor
  • Mortgage rate monitor
  • Github repo release monitor

Receiver Examples

  • Create an Okta Hook receiver
  • Create a SendGrid Event Webhook receiver

Create your first task

An iHook task allows you to schedule HTTP requests, and receive notifications based on response condition. This tutorial will show you how to set up an iHook task, and get an email notification when Bitcoin price drops to a certain level.

1. Setup HTTP request

After signing into iHook dashboard, click the CREATE TASK button at the top left corner. Then you will see the task creation form:

task-settings

Under the Request Settings and Request Schedule sections, provide the following values:

FieldValueNotes
Task NameBitcoin price monitorThe name of the task (optional)
URLhttps://api.coindesk.com/v1/bpi/currentprice.jsonCoinDesk API for Bitcoin price
Request MethodGET
Request HeadersNoneNo headers are needed
Request ScheduleEvery 5 minutesThe task will run once every day

With this setup, you are telling the task to issue a GET request to CoinDesk's Bitcoin price API every 5 minutes.

2. Setup notification

The above URL returns the following Bitcoin price data in JSON format:

{
   "time":{
      "updated":"Oct 25, 2020 18:16:00 UTC",
      "updatedISO":"2020-10-25T18:16:00+00:00",
      "updateduk":"Oct 25, 2020 at 18:16 GMT"
   },
   "disclaimer":"This data was produced from the CoinDesk Bitcoin Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org",
   "chartName":"Bitcoin",
   "bpi":{
      "USD":{
         "code":"USD",
         "symbol":"$",
         "rate":"12,997.0150",
         "description":"United States Dollar",
         "rate_float":12997.015
      },
      "GBP":{
         "code":"GBP",
         "symbol":"£",
         "rate":"9,962.8359",
         "description":"British Pound Sterling",
         "rate_float":9962.8359
      },
      "EUR":{
         "code":"EUR",
         "symbol":"€",
         "rate":"10,956.3927",
         "description":"Euro",
         "rate_float":10956.3927
      }
   }
}

Let us set up a notification condition around the U.S. dollar property, so that we can be notified when Bitcoin price drops to our desired level. We'll choose email in this example, but you can also receive notifications via Slack.

Under the Notification section, click on ADD button next to Email label:

add-notification

Then a notification setup dialog will show up:

edit-notification

Then provide the following values in the dialog:

FieldValueNotes
SourceResponse Body (JSON)Parse the response body as JSON
Propertybpi.USD.rate_floatJSON path for the Bitcoin price property measured in U.S. dollars
Comparisonless than (number)
Target Value6000Check if Bitcoin price is lower than $6,000
Email[email protected]The email address to receive notification when the condition is met

Click SAVE, you will see the new notification appear under the Notification section:

saved-notification

3. Save task

Now your task is ready, click CREATE at the bottom of the page:

create-task-button

Then you'll see your task has been created and in ACTIVE status:

saved-task

4. Test task

Now you might be wondering: how do I make sure my task settings are properly configured, so I won't miss the Bitcoin price drop event when it actually happened? This is where TEST button becomes helpful. The TEST button will trigger the HTTP request right away, and send notifications when the configured conditions are met.

Let us pick a Bitcoin price that is higher than current price for testing purpose, say 20,000. Under your newly created task, let us modify the email notification by clicking the edit button:

edit-notification-button

Change the Target Value field from 6000 to 20000, then click SAVE. Now, our task should be able to send out an email notification when Bitcoin price is lower than $20,000. Let us see that in action. Now click TEST at page top, the task page will switch to History tab, where we can check the HTTP request status in real-time. Within a couple of seconds, you should see the execution status turn into COMPLETED:

history

At this point, you should receive an email triggered by the task:

email

Nice! Looks like our notification logic is correct, now you can revert the email notification by changing the Target Value back to 6000, and then click SAVE.

Congratulations! You've successfully set up your first iHook task as a Bitcoin low price monitor!

Create your first receiver →
  • 1. Setup HTTP request
  • 2. Setup notification
  • 3. Save task
  • 4. Test task
Copyright © 2024 iHook, Inc.