PHP code example of otis22 / vetmanager-token

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

    

otis22 / vetmanager-token example snippets


use function Otis22\VetmanagerToken\credentials;
use function Otis22\VetmanagerToken\token;

$credentials = credentials('login', 'password', 'app_name');
$domainName = 'myclinic'; // first part from programm url address
echo token($credentials, $domainName)->asString();

use GuzzleHttp\Client;
use function Otis22\VetmanagerUrl\url;
use function Otis22\VetmanagerToken\credentials;
use function Otis22\VetmanagerToken\token_with_client;

$billingClient = new Client(['headers' => ['User-Agent' => 'my-service/1.0']]);
$crmClient = new Client(['headers' => ['User-Agent' => 'my-service/1.0']]);
$clinicUrl = url('myclinic', $billingClient); // Billing request happens here.
$token = token_with_client(credentials('login', 'ExamplePassword123', 'app_name'), $clinicUrl, $crmClient);
echo $token->asString(); // Token request happens here.