Configuring Custom Postback URL | Webhooks

A webhook, or the Uptime.com Custom Postback URL, allows you to push alerts to any third party system that can expect to receive an application/json encoded payload in the body of a request.

Webhooks are useful for managing alert data internally, and creating a history of specific alerts with the metrics your team needs to know. Unlike specific integrations, which handle data output for visualizing metrics, webhooks require administrators to maintain their own system for translating and receiving this data.

Table of Contents

Custom Postback URLs At A Glance

  • Receive an HTTP POST in a JSON serialized string containing the expected results
  • Post data received to a third party URL

Integration Setup

Return

The Custom Postback URL first requires you to create your own website or web application. You will need to setup a handler, accessible by a public URL which you enter into the URL field. We will then POST the alert data in JSON format to this URL.

Servers can expect to receive these keys in the HTTP POST in a JSON serialized string:

{"data":
{"service":
{"id":"",
"name": "",
"device_id":
"monitoring_service_type": "",
"is_paused": false,
"msp_address": "",
"msp_interval": 1,
"msp_sensitivity": 2,
"msp_num_retries": 2,
"msp_url_scheme": "",
"msp_url_path": "",
"msp_port": null,
"msp_protocol": "",
"msp_username": "",
"msp_dns_server": "",
"msp_dns_record_type": "",
"msp_send_string": "",
"msp_expect_string": "",
"msp_expect_string_type": "",
"msp_encryption": "",
"msp_threshold": 40,
"msp_notes": "",
"msp_include_in_global_metrics":
"msp_use_ip_version": "",
"monitoring_service_type_display": "",
"display_name": "",
"short_name": "",
"tags": ["tag1, tag2"]},
"account":
{"id":,
"name": "",
"brand": "",
"site_url": ""} ,
"integration":
{"id":
"name": "",
"module": "",
"module_verbose_name": "",
"is_enabled": true,
"is_errored": false,
"is_test_supported": true,
"postback_url": "",
"headers": "",
"use_legacy_payload": false},
"date": "2019-12-08T10:04:35.806Z",
"alert":
{"id":,
"created_at": "2019-12-08T10:04:35.806Z",
"state": "",
"output": "",
"short_output": "",
"is_up": false},
"global_alert_state":
{"id":,
"created_at": "2019-12-08T10:04:35.806Z",
"num_locations_down": 2,
"state_is_up": false,
"state_has_changed": true,
"ignored": false},
"device":
{"id":, "name": "",
"address": "",
"is_paused": false,
"display_name": ""},
"locations": ["GBR", "US-Central"],
"links":
{"alert_details": "",
"real_time_analysis": ""}},
"event": "alert_raised"
}

Basic setup requires a name for your integration, and the URL that will receive the HTTP POST from Uptime.com.

postbackwebhook.setup.png

Once you've configured your Custom Postback URL, you will need to assign it to a contact and make sure that contact is notified when a Check fails.

Custom HTTP Headers

Return

To use optional custom HTTP Headers, structure your data as follows:

X-Test-Header: some_value

Please note that content-type is automatically set to application/json. We do not support specifying a custom user agent for our webhook integration.

Assign Integration to Contacts

Return

To add your integration to an existing contact, click on or type the name of the contact into the Assign to Contacts field within the integration setup screen. 

You can designate a new contact from within the integration setup. Simply enter the name of your new contact into the Assign to Contacts field, and select it as depicted below:

postbackwebhook.comtact.png

Uptime.com will create a new contact and assign the integration to it. You can find this contact when you click Notifications > Contact.

Assign Integration Contact to a Check

Return

If you have created a new or dedicated contact for your integration, you will need to add it to specific checks. If you have assigned the integration to a contact that is already assigned to one (or more) checks, you may skip this step.

Return to your Check’s Edit screen and assign this contact to the Contacts field to be notified of a downtime event. Alert data will appear in real time.

Test Your Integration

Return

Test your integration with one of the following two options:

  1. Force the Check assigned to your Integration to fail by altering it (HTTPS checks can use a misspelling of the domain, for example)
  2. Click Notifications > Contacts, then click Actions > Test to send a test to the Contact

postbackwebhook.test.png

Third-Party Providers

Return

Some third-party providers use this postback URL method to create an integration with Uptime.com. Here is a list of providers that utilize this method:

For a list of third-party integrations, see our article Overview of Push Notifications.

Please note: Uptime.com doesn't control the functionality of any third-party providers or integration partners, and the setup process can be changed at any time without warning or notice.

Final Thoughts

Return

Custom Postback URLs, or webhooks, are an excellent tool for quickly extract information from Uptime.com and use it in a third-party system. For any technical assistance from the Uptime.com side, please contact support@uptime.com for help!

Was this article helpful?
4 out of 5 found this helpful