PHP code example of imbue / challonge-php

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

    

imbue / challonge-php example snippets


$challonge = new Challonge('api_key');

// Retrieve a set of tournaments created with your account.
$tournaments = $challonge->getTournaments();

// Retrieve a single tournament
$tournament = $challonge->getTournament('tournament_id');

// Create a new tournament
$tourament = $challonge->createTournament([
    'tournament' => [
        'name' => 'Tournament name',
        'url' => 'imbues_new_tournament',
        ...
    ]
]);

// Update an existing tournament
$tournament = $challonge->updateTournament($tournament, [
    'tournament' => [
        'name' => 'New tournament name',
        ...
    ]
]);

// for the full list of available parameters visit: https://api.challonge.com/v1/documents/tournaments/create

getTournaments();
getTournament($tournament);
createTournament($params);
updateTournament($tournament, $params);
deleteTournament($tournament);

getParticipants($tournament);
getParticipant($tournament. $participant);
createParticipant($tournament, $params);
updateParticipant($tournament, $participant, $params);
randomizeParticipants($tournament);

getMatches($tournament);
getMatch($tournament, $match);
updateMatch($tournament, $match, $params);
bash
composer