1. Go to this page and download the library: Download lexonouri/serwisant-api 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/ */
lexonouri / serwisant-api example snippets
use Serwisant\SerwisantApi;
// get own client and secret by creating an application via webpage
// 4th argument is a access token cache, it's optional, but recommended for performance reasons
$access_token = new SerwisantApi\AccessTokenOauth('client', 'secret', 'public', (new SerwisantApi\AccessTokenContainerFile));
$api = new SerwisantApi\Api();
$api->setAccessToken($access_token);
/* please note __typename at each type - it's rByToken(token: $token) {
__typename
displayName
status {
__typename
displayName
}
}
}';
/* @var SerwisantApi\Types\SchemaPublic\Repair $repair */
$repair = $api->publicQuery()->newRequest()->set($query, ['token' => 'abc-def'])->execute()->fetch();
echo $repair->displayName;
echo $repair->status->displayName;