PHP code example of viagogo / gogokit

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

    

viagogo / gogokit example snippets


// All methods ocs url

$configuration = new Viagogo\Core\ViagogoConfiguration();

$configuration->clientId = 'CLIENT_ID';
$configuration->clientSecret = 'CLIENT_SECRET';

$viagogoClient = new Viagogo\ViagogoClient($configuration);
$viagogoClient->setToken($viagogoClient->getOAuthClient()->getClientAccessToken());

// Get an event by id
$event = $viagogoClient->getEventClient()->getEvent(676615);

// Get a list of results that match your search query
$searchResults = $viagogoClient->getSearchClient()->getSearch("FC Barcelona tickets");