L2L.ink

Shorten links for free and without ads

API Documents

if you are a developer this documents helps you to shorten URLs in your programs . create new short URL , edit , delete & analyze you data with a REST API

SSL Connection

you must use a SSL connection to be authorized with you CLIENT_TOKEN and send request to L2L Server

Create Client

Login or Create account into L2L . you can see your CLIENT_TOKEN code into home page . use it for append changes into your profile or links

use PHP Library

using library is optional and its just for easy coding. whatever check this l2l-PHP-URL-Shortner in github and get a clone of project .

this codes show you how install l2l-PHP-URL-Shortner

PHP Library


require("/path/to/l2l.php");
$l2l = new l2l("CLIENT_TOKEN");
                

Create Client

Login or Create account into L2L . you can see your CLIENT_TOKEN code into home page . use it for append changes into your profile or links

Methodes

profile

this method used for connection to profile with a token , and get profile details.

API URL:

https://l2l.ink/api/{CLIENT_TOKEN}/profile

PHP Library


require("/path/to/l2l.php");
$l2l = new l2l("CLIENT_TOKEN");
$profile = $l2l->profile(); // array response
                

retoken

change your CLIENT_TOKEN . when using this method all clients using CLIENT_TOKEN will signed out

API URL:

https://l2l.ink/api/{CLIENT_TOKEN}/retoken

PHP Library


require("/path/to/l2l.php");
$l2l = new l2l("CLIENT_TOKEN");
$new_token = $l2l->retoken(); // new token as a string
                

urls

get all links of your account

API URL:

https://l2l.ink/api/{CLIENT_TOKEN}/urls

PHP Library


require("/path/to/l2l.php");
$l2l = new l2l("CLIENT_TOKEN");
$links = $l2l->urls(); // array
                

url

get all data of a URL ID

API URL:

https://l2l.ink/api/{CLIENT_TOKEN}/url/{SHORT_URL_ID}

PHP Library


require("/path/to/l2l.php");
$l2l = new l2l("CLIENT_TOKEN");
$url_data = $l2l->url("SHORT_URL_ID"); // array
                

short

create a new short URL

API URL:

https://l2l.ink/api/{CLIENT_TOKEN}/short

parameters

url

require

a valid URL

PHP Library


require("/path/to/l2l.php");
$l2l = new l2l("CLIENT_TOKEN");
$short_url_data = $l2l->short("http://any-valid.url/path"); // array
                

edit

change details of a previous Short URL

API URL:

https://l2l.ink/api/{CLIENT_TOKEN}/edit/{SHORT_URL_ID}

parameters

url

optional

change short URL target link with a valid URL

token

optional

change path address of short URL

PHP Library


require("/path/to/l2l.php");
$l2l = new l2l("CLIENT_TOKEN");
$edit_result = $l2l->edit("SHORT_URL_ID",[
    'url' => 'https://new.target/link',
    'token' => 'custom_path'    
]); // array
                

delete

delete a URL from account

API URL:

https://l2l.ink/api/{CLIENT_TOKEN}/delete/{SHORT_URL_ID}

PHP Library


require("/path/to/l2l.php");
$l2l = new l2l("CLIENT_TOKEN");
$delete_result = $l2l->delete("SHORT_URL_ID"); // array
                

analyze

get URL performance , clicks and IPs by date

API URL:

https://l2l.ink/api/{CLIENT_TOKEN}/analyze/{SHORT_URL_ID}

PHP Library


require("/path/to/l2l.php");
$l2l = new l2l("CLIENT_TOKEN");
$analyze_result = $l2l->analyze("SHORT_URL_ID"); // array