datana-gmbh / url-shortener-api
API for UrlShortener
Installs: 25 801
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
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-11-30 00:45:56 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