datana-gmbh / url-shortener-api
API for UrlShortener
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Installs: 25 801
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
pkg:composer/datana-gmbh/url-shortener-api
Requires
- php: >=8.1
 - oskarstark/trimmed-non-empty-string: ^1.0
 - psr/log: ^2.0 || ^3.0
 - symfony/http-client: ^6.2.9
 - thecodingmachine/safe: ^2.5
 - webmozart/assert: ^1.11
 
Requires (Dev)
- ergebnis/composer-normalize: ^2.30.2
 - ergebnis/php-cs-fixer-config: ^5.5
 - ergebnis/test-util: ^1.6
 - phpstan/extension-installer: ^1.3
 - phpstan/phpstan: ^1.10.14
 - phpstan/phpstan-webmozart-assert: ^1.2.4
 - phpunit/phpunit: ^9.6.7
 - thecodingmachine/phpstan-safe-rule: ^1.2
 
This package is auto-updated.
Last update: 2024-12-30 01:03:06 UTC
README
Usage
Installation
composer require datana-gmbh/url-shortener-api
Setup
use Datana\UrlShortener\Api\UrlShortenerClient; $baseUri = 'https://url-shortner.datana.app'; $username = '...'; $password = '...'; $client = new UrlShortenerClient($baseUri, $username, $password);
Generate short URL
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