Branch |
PHP |
master |
|
composer require datana-gmbh/url-shortener-api
use Datana\UrlShortener\Api\UrlShortenerClient;
$baseUri = 'https://url-shortner.datana.app';
$username = '...';
$password = '...';
$client = new UrlShortenerClient($baseUri, $username, $password);
use Datana\UrlShortener\Api\UrlShortenerApi;
use Datana\UrlShortener\Api\UrlShortenerClient;
$client = new UrlShortenerClient(/* ... */);
$api = new UrlShortenerApi($client);
$response = $api->generateShortUrl('https://www.google.com');
$response->getShortUrl(); // returns sth. like https://......./12DDFFS3