Quickscan API client written in PHP.
Install the API client through Composer with the following command:
composer require guardian360/quickscan-php-client
The API client has a couple of requirements:
-
= PHP 5.5
- PHP cURL extension
- GuzzleHttp library (automatically installed along with the Quickscan client)
<?php
require 'vendor/autoload.php';
// Initialize a new API client
$client = new Guardian360\Quickscan\Api\Client;
// URL to scan
$url = 'http://example.com';
// Example contact. These four fields are mandatory
$contact = [
'company' => 'Acme',
'firstname' => 'John',
'surname' => 'Doe',
'email' => 'johndoe@example.com',
];
// Login so we receive a JWT token. Password will be encoded
$client->login('johndoe@example.com', 'test');
// Always call the scan method before sending a report!
$scanResults = $client->scan($url);
// Send a report to the contact
$response = $client->sendReport($url, $contact);