PHP code example of biscolab / updown-php-sdk

1. Go to this page and download the library: Download biscolab/updown-php-sdk 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/ */

    

biscolab / updown-php-sdk example snippets



use Biscolab\UpDown\UpDown;
use Biscolab\UpDown\Objects\Check;
use Biscolab\UpDown\Fields\UpDownRequestFields;

// Initialize UpDown 
UpDown::init([
    UpDownRequestFields::API_KEY => '<YOUR_UPDOWN_API_KEY>'
]);

// Create an empty "Check" CRUD object 
$check = new Check();

// OR

// Create an existing "Check" CRUD object 
$check = new Check($attributes);

$check = new Check($attributes);
$check->create();

$check = new Check($token);
$check->read();

// get data as array
$array_data = $check->toArray();

// get single value
$url = $check->{UpDownRequestFields::URL};


$check = new Check($token);
$check->update($attributes);

$check = new Check($token);
$deleted = $check->delete();

$check = new Check($token);
$metrics = $check->getMetrics($from, $to, $group);

$check = new Check($token);
$downtimes = $check->getDowntimes($page);