PHP code example of keboola / service-client

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

    

keboola / service-client example snippets



use Keboola\ServiceClient\ServiceDnsType;
use Keboola\ServiceClient\ServiceClient;

// by default configured to return public URLs
$serviceClient = new ServiceClient('eu-central-1.keboola.com');
$serviceClient->getStorageApiUrl(); // https://connection.eu-central-1.keboola.com
$serviceClient->getEncryptionUrl(); // https://encryption.eu-central-1.keboola.com

// explicitly request internal URL
$serviceClient->getStorageApiUrl(ServiceDnsType::INTERNAL); // http://connection-api.connection.scv.cluster.local

// can be configured to return internal URLs by default
$serviceClient = new ServiceClient('eu-central-1.keboola.com', ServiceDnsType::INTERNAL);
$serviceClient->getStorageApiUrl(); // http://connection-api.connection.scv.cluster.local