PHP code example of unikorp / kong-admin-api

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

    

unikorp / kong-admin-api example snippets




nfigure KongAdminApi client
$configurator = new \Unikorp\KongAdminApi\Configurator();
$configurator->setBaseUri('http://example.com:8001/');

// create KongAdminApi client
$client = new \Unikorp\KongAdminApi\Client($configurator);

// retrieve node information
$response = $client->getNode('information')->retrieveNodeInformation();
$information = json_decode($response->getBody()->getContents(), true);

var_dump($information);