Different payloads for our Webhook events

Oh Dear generates will notify you of each event if you've enabled webhooks. Here, we'll list all events we can fire.

Generic payloads

All webhook data will contain a set of recurring data points.

First, there's confirmation about which event you're receiving and which date this was generated.

{
    "type":"uptimeCheckFailed",
    "date_time":"20180312092737",
    ...
}

Next, there are details on the site that this event took place on. This will look like this:

{
    ...
    "site":{
        "id":1,
        "url":"https:\/\/yoursite.tld",
        "uses_https":true,
        "sort_url":"yoursite.tld",
        "team_id":1,
        "latest_run_date":"2018-03-12 20:27:34",
        "summarized_check_result":"failed",
        "created_at":"2018-03-12 20:24:54",
        "updatedAt":"2018-03-12 20:24:54",
        "checks":[
            {
                "id":1,
                "type":"uptime",
                "enabled":true,
                "human_readable_check_type":"Uptime",
                "site_id":1,
                "latest_run_result":"failed",
                "latest_run_ended_at":"2018-03-12 20:27:34",
                "latest_run_id":2,
                "latest_run_report_url":"https:\/\/ohdear.app\/sites\/1\/history\/runs\/1",
                "always_running":false
            },
            ...
        ]
    },
}

Additionally, there is meta-data present about the time the event took place.

"run":{
    ...
    "started_at":"2018-03-12 20:27:33",
    "ended_at":"2018-03-12 20:27:34",
    "created_at":"2018-03-12 20:27:31",
    "updatedAt":"2018-03-12 20:27:34",
}

The actual payload of each individual event can be found in the runs block, which contains all relevant data pertaining to the event that just happened. Each of those blocks will be updated in more detail below.

Uptime monitor

Here's the payload you can expect for our uptime monitoring.

{
   "type":"uptimeCheckFailed",
   "date_time":"20180312092737",
   "site":{
      "id":1,
      ... /* See above */
   },
   "run":{
      "id":19830466,
      "check_id":10988,
      "parameters":null,
      "result":"failed",
      "result_payload":{
         "checkerResult":{
            "checkerServer":{
               "name":"uptime-checker-paris",
               "city":"Paris",
               "country":"France",
               "ip":"45.32.146.84"
            },
            "response":[

            ],
            "lookForString":"",
            "lookForStringFound":true,
            "error":{
               "type":"connectionError",
               "errorNumber":6,
               "description":"Could not resolve host: yoursite.tld"
            },
            "statistics":{
               "url":"https:\/\/yoursite.tld\/",
               "content_type":null,
               "http_code":0,
               "header_size":0,
               "request_size":0,
               "filetime":-1,
               "ssl_verify_result":0,
               "redirect_count":0,
               "total_time":7.6000000000000004184153024056058711721561849117279052734375e-5,
               "namelookup_time":0,
               "connect_time":0,
               "pretransfer_time":0,
               "size_upload":0,
               "size_download":0,
               "speed_download":0,
               "speed_upload":0,
               "download_content_length":-1,
               "upload_content_length":-1,
               "starttransfer_time":0,
               "redirect_time":0,
               "redirect_url":"",
               "primary_ip":"",
               "certinfo":[

               ],
               "primary_port":0,
               "local_ip":"",
               "local_port":0
            }
         },
         "alternativeLocationCheckerResult":{
            "checkerServer":{
               "name":"uptime-checker-bangalore",
               "city":"Bangalore",
               "country":"India",
               "ip":"139.59.75.39"
            },
            "response":[

            ],
            "lookForString":"",
            "lookForStringFound":true,
            "error":{
               "type":"connectionError",
               "errorNumber":6,
               "description":"Could not resolve host: yoursite.tld"
            },
            "statistics":{
               "url":"https:\/\/yoursite.tld\/",
               "content_type":null,
               "http_code":0,
               "header_size":0,
               "request_size":0,
               "filetime":-1,
               "ssl_verify_result":0,
               "redirect_count":0,
               "total_time":6.600000000000000506018837942434629439958371222019195556640625e-5,
               "namelookup_time":0,
               "connect_time":0,
               "pretransfer_time":0,
               "size_upload":0,
               "size_download":0,
               "speed_download":0,
               "speed_upload":0,
               "download_content_length":-1,
               "upload_content_length":-1,
               "starttransfer_time":0,
               "redirect_time":0,
               "redirect_url":"",
               "primary_ip":"",
               "certinfo":[

               ],
               "primary_port":0,
               "local_ip":"",
               "local_port":0
            }
         }
      },
   }
}

Broken Links report

Whenever a crawl of your site is finished, and broken links were found, a payload like this will be fired to your webhook endpoints.

{
   "type":"brokenLinksFound",
   "date_time":"20180312092500",
   "site":{
      "id":1,
      ... /* See above */
   },
   "run":{
      "id":19829463,
      "check_id":10989,
      "parameters":null,
      "result":"failed",
      "result_payload":{
         "broken_links":[
            {
               "crawled_url":"https:\/\/yoursite.tld\/",
               "status_code":null,
               "found_on_url":""
            }
         ],
         "crawled_urls":[
            {
               "crawled_url":"https:\/\/yoursite.tld\/",
               "status_code":null,
               "found_on_url":""
            }
         ],
         "whitelist":null
      },
   }
}