PHP code example of veridu / idos-sdk-php

1. Go to this page and download the library: Download veridu/idos-sdk-php 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/ */

    

veridu / idos-sdk-php example snippets


/**
 * Instantiates an auth object of CredentialToken Class.
 * For each type of Authorization, there is a Class to be instantiated.
 */
$auth = new \idOS\Auth\CredentialToken(
	$credentials['credentialPublicKey'],
	$credentials['handlerPublicKey'],
	$credentials['handlerPrivKey']
);


$sdk = \idOS\SDK::create($auth);

/**
 * Making a /GET request to the scores endpoint, listing all scores.
 */
$response = $sdk
    ->Profile($credentials['username']) //passing the username in the Profile Class constructor
    ->Scores->listAll();

/**
 * Making a /POST request to gates endpoint, creating a new gate
 */
$response = $sdk
	->Profile($credentials['username']) //passing the username in the Profile Class constructor
	->Gates->createNew('18+', true);

bash
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install