PHP code example of affittocertificato / clientapi

1. Go to this page and download the library: Download affittocertificato/clientapi 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/ */

    

affittocertificato / clientapi example snippets



$client = new \AffittoCertificato\Api\Client();

if (!$client->login('username','password')){
  throw new Exception ("Unable to login");
}

// get ratings using user's email address
if (!$client->userRatingByEmail('[email protected]')){
  throw new Exception ("Unable to get ratings");
}

// to get api results use method getResponse() which return an object as described later in ## responses section
$result = $client->getResponse();
if (!$result->success){
  throw new Exception ("Request failed");
}