PHP code example of toppy / sendcloud-v2-client
1. Go to this page and download the library: Download toppy/sendcloud-v2-client 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/ */
toppy / sendcloud-v2-client example snippets
Configure HTTP basic authorization: HTTPBasicAuth
$config = Toppy\Sendcloud\V2\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new Toppy\Sendcloud\V2\Api\BrandsApi(
// If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`.
// This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->scPublicV2BrandsGetAllUserBrands();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BrandsApi->scPublicV2BrandsGetAllUserBrands: ', $e->getMessage(), PHP_EOL;
}