UpDown.io PHP SDK
Now you can find compete documentation here
First of all you need a UpDown.io account.
Further info/documentation will be ready ASAP.
You can install the package via composer:
composer require biscolab/updown-php-sdkFirst of all you need an API key: Get API Key
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);$checkis a CRUD object, so it hascreate,read,updateanddeletemethods available.$attributescould an array containing a list of attributes (Biscolab\UpDown\Fields\CheckFields) or a scalar value representing the token given by updown.io.
$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};Use Enum values like
UpDownRequestFieldsto avoid errors
$check = new Check($token);
$check->update($attributes);$check = new Check($token);
$deleted = $check->delete();$deletedis bool,trueif "ok",falseif something went wrong
$check = new Check($token);
$metrics = $check->getMetrics($from, $to, $group);$metricsis anf objact of classBiscolab\UpDown\Types\Metrics
$check = new Check($token);
$downtimes = $check->getDowntimes($page);$downtimesis anf objact of classBiscolab\UpDown\Types\DownTimes, a collection ofBiscolab\UpDown\Types\DownTimeobjects

