PHP code example of robertfausk / kurzlink-api-client

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

    

robertfausk / kurzlink-api-client example snippets




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);