error_reporting(E_ALL);
ini_set('display_errors', '1');
require __DIR__ . '/bootstrap.php';
use Exception\ProtectimusApiException;
define("USERNAME", "");
define("API_KEY", "");
define("API_URL", "");
try {
    $api = new ProtectimusApi(USERNAME, API_KEY, API_URL);
    /*echo "<br/>CREATING A TOKEN<br/>";
    	$response = $api->addUnifyToken(null, null, "OATH_HOTP", "SHA1", "HEX", "unifytoken", "unifytoken",
                        "a08bc52465e75aa1d99dc19338ebf2e291467fe2", "123456", null, null, null, 8, null);
    	echo print_r($response, true) . "<br/>";*/
    echo "GETTING SECRET KEY FOR GOOGLE AUTHENTICATOR TOKEN<br/>";
    $response = $api->getGoogleAuthenticatorSecretKey();
    echo print_r($response, true) . "<br/>";
    $secret = $response->response->key;
    echo "SECRET KEY FOR GOOGLE AUTHENTICATOR TOKEN =>>> " . $secret . "<br/>";
    echo "<br/>GETTING SECRET KEY FOR PROTECTIMUS MOBILE TOKEN<br/>";
    $response = $api->getProtectimusSmartSecretKey();
    echo print_r($response, true) . "<br/>";
    $secret = $response->response->key;
    echo "SECRET KEY FOR PROTECTIMUS MOBILE TOKEN =>>> " . $secret . "<br/>";
    echo "<br/>CREATING A TOKEN<br/>";
    $response = $api->addSoftwareToken(null, null, "MAIL", "*****@*****.**", "Mail token", null, null, null, null, null, null);
    echo print_r($response, true) . "<br/>";
    $tokenId = $response->response->id;
    echo "ID OF THE CREATED TOKEN =>>> " . $tokenId . "<br/>";
    // to add hardware token you must own it, because you need to
    // provide one-time password from this token