PHP code example of ckdarby / php-uptimerobot
1. Go to this page and download the library: Download ckdarby/php-uptimerobot library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ckdarby / php-uptimerobot example snippets
//Requires composer install to work
n settings
$config = [
'apiKey' => 'APIKEY',
'url' => 'https://api.uptimerobot.com'
];
try {
//Initalizes API with config options
$api = new API($config);
//Define parameters for our getMethod request
$args = [
'showTimezone' => 1
];
//Makes request to the getMonitor Method
$results = $api->request('/getMonitors', $args);
//Output json_decoded contents
var_dump($results);
} catch (Exception $e) {
echo $e->getMessage();
//Output various debug information
var_dump($api->debug);
}