PHP code example of gameserverapp / php-api-wrapper

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

    

gameserverapp / php-api-wrapper example snippets



$api = new GameserverApp\ApiWrapper\GSAClient('<api key>','<secret>');


$api = new GSAClient('<api key>','<secret>');

$api->servers();

$api->domainSettings();
 
$api->domainStat('hours-played');

$api->clusterStat('newbies');

$api->serverStat(132056, 'top-players');

$api->servers();

$api->group('00c666f6-d521-47ce-88f9-6ca36451bda0');
$api->groupStat('00c666f6-d521-47ce-88f9-6ca36451bda0', 'hours-played');

$api->groups();

$api->user('6c4de76f-3df4-4b75-85a0-b4557c3f3564');
$api->userStat('6c4de76f-3df4-4b75-85a0-b4557c3f3564', 'levels-gained');

$api->users();

$api->character('d1f6e8d1-0265-43ad-947e-c6bebe3343ee');
$api->characterStat('d1f6e8d1-0265-43ad-947e-c6bebe3343ee', 'xp-gained');

$api->characters();
$api->topCharacters();
$api->freshCharacters();
$api->onlineCharacters();
$api->spotlightCharacters();