PHP code example of boldgrid / reseller-api

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

    

boldgrid / reseller-api example snippets


$ composer 



use Boldgrid\Api\Boldgrid;

use Boldgrid\Api\Environment\Sandbox;

$api = new Boldgrid( new Sandbox );

use Boldgrid\Api\Environment\Sandbox;

$api = new Boldgrid();
$api = $api->setEnvironment( new Sandbox );

use Boldgrid\Api\Environment;
use Boldgrid\Api\Storage;

$api = new Boldgrid( new Environment\Sandbox, new Storage\Memcache );

use Boldgrid\Api\Environment\Sandbox;
use Boldgrid\Api\Storage\Memcache;

$api = $api
	->setEnvironment( new Sandbox )
	->setStorage( new Memcache );

$api = $api
	->setKey( $key )
	->setResellerKey( $resellerKey );

$api = $api
	->setAuth( 'basic' )
	->setKey( $key )
	->setResellerKey( $resellerKey );

$api = $api
	->setAuth( 'key' )
	->setKey( $key )
	->setResellerKey( $resellerKey );

$api->key()->list();



use Boldgrid\Api\Boldgrid;
use Boldgrid\Api\Environment\Sandbox;
use Boldgrid\Api\Storage\Memcache;

$api = new Boldgrid();
$api = $api
	->setEnvironment( new Sandbox )
	->setStorage( new Memcache )
	->setKey( $key )
	->setResellerKey( $resellerKey );

$call = $api
	->key()
	->list();

var_dump( $call ); die;


$api->auth()
	->getToken( $key, $resellerKey );

$api->coin()
	->balance( $connectId );

$api->coin()
	->add( $connectId, $coins );

$api->coin()
	->remove( $connectId, $coins );

$api->key()
	->list();

$api->key()
	->details( $connectId );

$api->key()
	->create( $email, $isPremium );

$api->key()
	->suspend( $connectId, $reason );

$api->key()
	->unsuspend( $connectId, $reason );

$api->key()
	->revoke( $connectId );

$api->key()
	->changeType( $connectId, $type );

$api->key()
	->createReseller( $title, $email, $optional );

$api->site()
	->list( $connectId, $dateFrom, $dateTo );

$api->user()
	->update( $connectId, $email, $displayName );
$api->user()
	->updateReseller( $title, $email );