Very simple api client written in PHP for url shortener kurzelinks.de which supports ogy.de, t1p.de, 0cn.de, kurzelinks.de and also own domains.
composer require --dev robertfausk/kurzlink-api-client
<?php
use Robertfausk\KurzlinkApiClient\KurzlinkClient;
$apiKey = 'your secret api key';
$kurzlinkAddress = 't1p.de';
$useSandbox = true;
$client = KurzlinkClient::create($apiKey, $kurzlinkAddress, $useSandbox);
$urlToShorten = 'https://google.de/';
$requestParams = [ // feel free to use every param from api doc
'requesturl' => '',
];
$shortUrl = $client->request($urlToShorten, $requestParams);
Have a look at CHANGELOG for detailed information.
Copy phpunit.xml.dist and insert your api key to be able to run the integration tests.
Start docker-compose with php web driver
docker-compose up php7.2
Run phpunit tests
docker-compose exec php7.2 vendor/bin/phpunit
Created by Robert Freigang robertfausk.