guardian360/quickscan-php-client

Guardian360 Quickscan API client class

1.1 2016-10-03 09:25 UTC

This package is auto-updated.

Last update: 2024-04-17 18:47:36 UTC


README

Quickscan API client written in PHP.

Installation

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)

Usage

<?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);