PHP code example of rstmgsnvimax / irisnet-ai-php-api-client

1. Go to this page and download the library: Download rstmgsnvimax/irisnet-ai-php-api-client 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/ */

    

rstmgsnvimax / irisnet-ai-php-api-client example snippets





 Configure API key authorization: LICENSE-KEY
$config = Irisnet\API\Client\Configuration::getDefaultConfiguration()->setApiKey('LICENSE-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Irisnet\API\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('LICENSE-KEY', 'Bearer');


$apiInstance = new Irisnet\API\Client\Api\AICheckOperationsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$configId = 'configId_example'; // string | The configuration id from the Basic Configuration operations.
$biometricCheckRequestData = {"callback":{"callbackUrl":"https://www.example.com/callback?ageestimation"},"selfieImage":"/9j/4AAQSkZJRgABAQEASABIAAD..."}; // \Irisnet\API\Client\Model\BiometricCheckRequestData | The BiometricCheckRequestData containing data needed for the age verification check.

try {
    $result = $apiInstance->ageVerification($configId, $biometricCheckRequestData);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AICheckOperationsApi->ageVerification: ', $e->getMessage(), PHP_EOL;
}