PHP code example of resellerinterface / api-client-php

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

    

resellerinterface / api-client-php example snippets




use ResellerInterface\Api\Client;

// create a new client
$client = new Client();

// login
$client->login( "username", "password", 23456 ); // username, password, resellerId

// make a request
$response = $client->request( "reseller/details", ['resellerID' => 'OWN']);
var_dump($response->getData());
// response
//[
//	'time' => 12,
//	'state' => 1000,
//	'stateName' => 'OK',
//	'stateParam' => '',
//	'reseller' => [
//		'resellerID' => 23456,
//		'parentID' => 23455,
//		'state' => 'ACTIVE',
//		'company' => 'Acme Corp.',
//		'firstname' => 'John',
//		'lastname' => 'Doe',
//		'street' => 'Mainstreet',
//		'number' => '1223',
//		'postcode' => '10115',
//		'city' => 'Berlin',
//		'country' => 'DE',
//		'mail' => '[email protected]',
//		'phone' => '+491234567890',
//		'fax' => '',
//		'parents' => [
//			0 => 23455,
//		],
//		'settings' => [
//			'group' => [
//				'name' => 'value',
//			],
//		],
//	],
//	'user' => [
//		'userID' => 12345,
//		'mainUser' => true,
//		'state' => 'ACTIVE',
//		'username' => 'User',
//		'password' => '****',
//		'settings' => [
//			'group' => [
//				'name' => 'value',
//			],
//		],
//		'rightsCategory' => 51,
//		'rightsGroups' => [
//			0 => 912,
//			1 => 913,
//		],
//		'directRights' => [
//			'category' => [
//				'group' => [
//					'function' => true,
//				],
//			],
//		],
//		'rights' => [
//			'category' => [
//				'group' => [
//					'function' => true,
//				],
//			],
//		],
//	],
//]
bash
composer