PHP code example of teambattles / sdk

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

    

teambattles / sdk example snippets



use TeamBattles\Sdk\TeamBattlesClientFactory;

$client = TeamBattlesClientFactory::create(getenv('TEAMBATTLES_API_KEY'));

// List the authenticated user's matches (setNumItems(25);
$result = $client->user()->matches()->post($body)->wait();
foreach ($result->getPage() as $match) {
    echo $match->getId() . ' ' . $match->getStatus()->value . PHP_EOL;
}