API

How to add a new check in Uptimerobot via API

JJ
Jobin Joseph · Founder and CEO
·Published 12 September 2018·1 min read

Today I was thinking to automate the new addition of website check to our monitoring systems. Since we are using multiple providers for website monitoring, it is a headache to go to each portal and add the website to the portals.

So, I have decided to add a Jenkins key where a single click will add the website to all of our monitoring providers.

Recently we have added uptimerobot to our monitoring providers.

1. Get the Alert Contact ID from uptimerobot

You can run the below command to get the ID of  your alter contacts


curl --data "api_key=u612113-XXXXXXXXXXXXXXXX" https://api.uptimerobot.com/v2/getAlertContacts

Copy the ID received from the output id":"111111"

2. Call the newMonitor API to add new check

Below is the command line argument to add a website to uptimerobot.com . You just need to replace the api_key on the below curl command.

curl --data "api_key=XXXXXXXXXXXXXX&alert_contacts=111111&friendly_name=test.com&url=http://test.com&type=1" https://api.uptimerobot.com/v2/newMonitor

api_key = get it from your uptimerobot account settings

alert_contacts =  Get it from the step 1 output.

If everything went fine, You will reveive the following output.

{"stat":"ok","monitor":{"id":7878787878,"status":1}}

Jobin Joseph
Jobin Joseph, Founder and CEO
5x AWS Certified, ISO 27001:2022 Lead Implementer, 17+ years building cloud infrastructure for regulated industries.
About Jobin →

Reading this because your AWS bill or uptime is a problem?

30 minutes, direct with the founder, no sales pitch: one specific recommendation for your AWS workload.

Book a free 30-minute review
30 min Free Consultation →