Easily use the API of the website monitoring service UptimeRobot.
This package requires PHP 7+ and uses cUrl.
This package can be used in any PHP project or with any framework. The packages is tested in PHP 7.0.
You can install the package via composer:
composer require vdhicts/uptimerobot-api-client
This package is just an easy client for using the UptimeRobot API. Please refer to the API documentation for more information about the requests.
use Vdhicts\UptimeRobot\Client;
// Load the configuration once, the URL is optional
$configuration = new Client\Configuration('API_KEY', 'OPTIONAL_API_URL');
// Start the client once
$client = new Client\Client($configuration);
// Perform the request, returns a string for further processing
$response = $client->perform('getMonitors', ['monitors' => '15830-32696-83920']);
The UptimeRobot API support XML and JSON as output format, so does this client. This can be changed by the third
parameter of the perform
method of the client.
When something goes wrong, the client will throw an exception which extends the UptimeRobotClientException
. If you
want to catch exceptions from this package, that's the one you should catch. Error responses from the API aren't
catched, so handle the response with some suspicion.
Any contribution is welcome, but it should meet the PSR-2 standard and please create one pull request per feature. In exchange you will be credited as contributor on this page.
This package is open-sourced software licensed under the MIT license.
Van der Heiden ICT services is the name of my personal company for which I work as freelancer. Van der Heiden ICT services develops and implements IT solutions for businesses and educational institutions.