📜 ⬆️ ⬇️

HostTrecker API: New Service Features

The Website Monitoring Service HostTracker offers the ability to manage and configure monitoring via an API, which is very convenient if you need to check a large number of websites or to integrate the service into various applications or recovery scripts. The API exists in two versions at once: HTTP (REST) ​​and SOAP.




')

Who can be useful?



Of course, the API is quite a useful and common thing, so HostTracker has long received requests from existing and potential customers for its presence. And the first developments appeared already several years ago. However, until now it has not been widely announced, but instead has been tested on different projects with different workloads. Therefore, now we have experience in using API in different situations.
The simplest case: to manage the monitoring of sites, the number of which exceeds a few hundred, is very problematic. The API allows you to quickly perform standard actions without digging into the web interface: put / delete a site to be monitored, add contacts, set up alerts.
Another example is the integration of a monitoring service into other web services. This allows for a very short time to significantly increase the functionality and attractiveness of their developments. In the modern web, the monitoring function (permanent or temporary) can be quite useful in many cases, as well as a bunch of other HostTrecker features — instant check, DNSBL check for a domain , content check, response time monitoring , and with all due imagination can be done without time-consuming. Many of these functions are already available in the API, new ones are being finalized.
And, of course, the API allows you to embed the service in your own mobile applications, making them even an order of magnitude cooler.

Usage example


In order to start working through the API, of course, you must log in. For more convenience, you can use different formats.

For example, xml, json, url encoding:

========================XML============================ POST https://www.host-tracker.com/api/web/v1/users/token HTTP/1.1 User-Agent: Fiddler Content-Type: text/xml Host: www.host-tracker.com Content-Length: 75 <LoginData> <login>user</login> <password>password</password> </LoginData> ======================JSON============================= POST https://www.host-tracker.com/api/web/v1/users/token HTTP/1.1 User-Agent: Fiddler Content-Type: application/json Host: www.host-tracker.com Content-Length: 37 {"login":"user", "password":"password"} ======================URL encoding====================== POST https://www.host-tracker.com/api/web/v1/users/token HTTP/1.1 User-Agent: Fiddler Content-Type: application/x-www-form-urlencoded Host: www.host-tracker.com Content-Length: 26 login=user&password=password ========================================================= 


As part of the REST API, using POST requests, you can create tasks: http-checks, ping-checks, and ports. Queries using the PUT method will allow editing a previously created task. Using the GET method, you can get the data accepted for setting up tasks or information about the tasks themselves, and using a DELETE request you can delete a previously configured task. So, a request with the GET method to the api / web / v1 / tasks / intervals resource will return the data on the testing intervals currently available: 1, 5, 10, etc. minutes

REST API documentation can be found here . In order to activate the API for your account, as well as for instructions on how to use SOAP, write to the support service. We will be glad to hear your wishes and recommendations.

Source: https://habr.com/ru/post/260375/


All Articles