1. URL Shortener API Integration


Refer this page to integrate our URL shortening API with your system and create short links right from your application.

We have made API integration really simple and easy, you just need to follow below instructions.

Contact us in case you face any issue while doing integration.


NOTE: API access is only available with paid plans. Explore all our plans here.

2. Create Short Link

With this API, you will be able to create short/custom links for the given destination links.

https://api.lnnkin.com/client/api/url/shorten
Name Type Description
long_url String Destination link which you want to short.
NOTE : The long_url must be passed as encoded URL. For example:
Original URL -> https://www.lnnkin.com/api-integration/plans?test=query string
Encoded URL -> https://www.lnnkin.com/api-integration/plans?test=query%20string
custom_name (Optional) String Custom name for short link
password (Optional) String Password for short link
domain (Optional) String User's custom domains. Only domains with active status will work. You can check the domain's status here.

Name Type Description
Content-Type String Content type of the request body. (eg. application/json)
Authorization String API access token of user. It can be found on My Profile page after selecting an API plan.

Name Type Description
success Boolean Its "true" when short link successfully generated else "false".
short_url String Generated short link
track_url String Tracking link for the generated short link.
tracking_id String Unique ID for the generated short link.
error_code String Unique code for occurred error.
error_message String Error description for the occured error.

Sample request & response for creating SHORT LINK

    
    // REQUEST HEADERS:
	// POST https://api.lnnkin.com/client/api/url/shorten 
	// Content-Type:application/json
	// Authorization:ZPX9blqJm2lJTsYyd9MFiVkb7wsdsudrefvMTz5Ud0UxgbGLua2DCU= 
	
	// REQUEST BODY:
	{ 
		"long_url":"https://www.lnnkin.com/api-integration/plans?test=query%20string",
		"password":"",
		"domain":"lnnk.in"
	}

Sample response (Success)

    
	{ 
		"success": true,
		"body": 
			{
				"short_url": "http://lnnk.in/EIf",
				"track_url": "https://www.lnnkin.com/url/track/ab2005c2-9c60-4e61-a36e-a44e51c1ede5",
				"tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5"
			}
	}

Sample response (Failure)

    
	{
 		"success": false,
 		"error_code": "LI05",
 		"error_message": "Invalid destination link."
	}


Sample request & response for creating CUSTOM LINK

    
    // REQUEST HEADERS:
	// POST https://api.lnnkin.com/client/api/url/shorten 
	// Content-Type:application/json
	// Authorization:ZPX9blqJm2lJTsYyd9MFiVkb7wsdsudrefvMTz5Ud0UxgbGLua2DCU= 
	
	// REQUEST BODY:
	{ 
		"long_url":"https://www.lnnkin.com/api-integration/plans?test=query%20string",
		"custom_name":"API-Test",
		"password":"",
		"domain":"lnnk.in"
	}

Sample response (Success)

    
	{ 
		"success": true,
		"body": 
			{
  				"short_url": "http://lnnk.in/@API-Test",
 				"track_url": "https://www.lnnkin.com/url/track/ab2005c2-9c60-4e61-a36e-a44e51c1ede5",
				"tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5"
 			}
	}

Sample response (Failure)

    
	{
		"success": false,
		"error_code": "LI07",
		"error_message": "Custom name already taken. Try something else."
	}

3. Edit Short Link

With this API, you will be able to update the destination link of an already created short/custom link.

https://api.lnnkin.com/client/api/url/edit
Name Type Description
long_url String New destination link which you want to update for existing short link.
NOTE : The long_url must be passed as encoded URL. For example:
Original URL -> https://www.lnnkin.com/api-integration/plans?test=query string
Encoded URL -> https://www.lnnkin.com/api-integration/plans?test=query%20string
tracking_id String Unique ID of the short link
password (Optional) String Password for short link

Name Type Description
Content-Type String Content type of the request body. (eg. application/json)
Authorization String API access token of user. It can be found on My Profile page after selecting an API plan.

Name Type Description
success Boolean Its "true" when short link successfully updated else "false".
error_code String Unique code for occurred error.
error_message String Error description for the occured error.

Sample request & response for editing SHORT LINK

    
    // REQUEST HEADERS:
	// POST https://api.lnnkin.com/client/api/url/edit 
	// Content-Type:application/json
	// Authorization:ZPX9blqJm2lJTsYyd9MFiVkb7wsdsudrefvMTz5Ud0UxgbGLua2DCU= 
	
	// REQUEST BODY:
	{ 
		"long_url":"https://www.lnnkin.com/api-integration/plans?test=query%20string",
		"tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5",
		"password":""
	}

Sample response (Success)

    
	{ 
 		"success": true
	}

Sample response (Failure)

    
	{
		"success": false,
		"error_code": "LI11",
		"error_message": "Invalid tracking ID."
	}

4. Disable Short Link

With this API, you will be able to disable an already created short/custom link.

https://api.lnnkin.com/client/api/url/disable
Name Type Description
tracking_id String Unique ID of the short link

Name Type Description
Content-Type String Content type of the request body. (eg. application/json)
Authorization String API access token of user. It can be found on My Profile page after selecting an API plan.

Name Type Description
success Boolean Its "true" when short link successfully disabled else "false".
error_code String Unique code for occurred error.
error_message String Error description for the occured error.

Sample request & response for disabling SHORT LINK

    
    // REQUEST HEADERS:
	// POST https://api.lnnkin.com/client/api/url/disable 
	// Content-Type:application/json
	// Authorization:ZPX9blqJm2lJTsYyd9MFiVkb7wsdsudrefvMTz5Ud0UxgbGLua2DCU= 
	
	// REQUEST BODY:
	{ 
		"tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5"
	}

Sample response (Success)

    
	{ 
		"success": true
	}

Sample response (Failure)


	{
 		"success": false,
 		"error_code": "LI11",
 		"error_message": "Invalid tracking ID."
	}	

5. Enable Short Link

With this API, you will be able to enable an already created short/custom link.

https://api.lnnkin.com/client/api/url/enable
Name Type Description
tracking_id String Unique ID of the short link

Name Type Description
Content-Type String Content type of the request body. (eg. application/json)
Authorization String API access token of user. It can be found on My Profile page after selecting an API plan.

Name Type Description
success Boolean Its "true" when short link successfully enabled else "false".
error_code String Unique code for occurred error.
error_message String Error description for the occured error.

Sample request & response for enabling SHORT LINK

    
    // REQUEST HEADERS:
	// POST https://api.lnnkin.com/client/api/url/enable 
	// Content-Type:application/json
	// Authorization:ZPX9blqJm2lJTsYyd9MFiVkb7wsdsudrefvMTz5Ud0UxgbGLua2DCU= 
	
	// REQUEST BODY:
	{ 
		"tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5"
	}

Sample response (Success)

    
	{ 
		"success": true
	}

Sample response (Failure)


	{
 		"success": false,
 		"error_code": "LI11",
 		"error_message": "Invalid tracking ID."
	}	

6. Delete Short Link

With this API, you will be able to permanently delete an already created short/custom link.

https://api.lnnkin.com/client/api/url/delete
Name Type Description
tracking_id String Unique ID of the short link

Name Type Description
Content-Type String Content type of the request body. (eg. application/json)
Authorization String API access token of user. It can be found on My Profile page after selecting an API plan.

Name Type Description
success Boolean Its "true" when short link successfully deleted else "false".
error_code String Unique code for occurred error.
error_message String Error description for the occured error.

Sample request & response for deleting SHORT LINK

    
    // REQUEST HEADERS:
	// POST https://api.lnnkin.com/client/api/url/delete 
	// Content-Type:application/json
	// Authorization:ZPX9blqJm2lJTsYyd9MFiVkb7wsdsudrefvMTz5Ud0UxgbGLua2DCU= 
	
	// REQUEST BODY:
	{ 
		"tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5"
	}

Sample response (Success)

    
	{ 
		"success": true
	}

Sample response (Failure)


	{
 		"success": false,
 		"error_code": "LI11",
 		"error_message": "Invalid tracking ID."
	}	

7. Get Short Link Details

With this API, you will be able to get the details of an already created short/custom link.

https://api.lnnkin.com/client/api/url/get
Name Type Description
short_url String Short link whose details are required.

Name Type Description
Content-Type String Content type of the request body. (eg. application/json)
Authorization String API access token of user. It can be found on My Profile page after selecting an API plan.

Name Type Description
success Boolean Its "true" when short link successfully deleted else "false".
error_code String Unique code for occurred error.
error_message String Error description for the occured error.

Sample request & response for getting SHORT LINK details

    
    // REQUEST HEADERS:
	// POST https://api.lnnkin.com/client/api/url/get 
	// Content-Type:application/json
	// Authorization:ZPX9blqJm2lJTsYyd9MFiVkb7wsdsudrefvMTz5Ud0UxgbGLua2DCU= 
	
	// REQUEST BODY:
	{ 
		"short_url": "http://lnnk.in/EIf"
	}

Sample response (Success)

    
	{
    "success": true,
    "body": {
        "short_url": "http://lnnk.in/EIf",
        "long_url": "https://www.lnnkin.com/api-integration/plans?test=query%20string",
        "track_url": "https://www.lnnkin.com/url/track/ab2005c2-9c60-4e61-a36e-a44e51c1ede5",
        "tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5"
    }
}

Sample response (Failure)


	{
	    "success": false,
	    "error_code": "LI16",
	    "error_message": "Invalid short URL."
	}	

8. Device Wise Clicks

With this API, you will be able to track the device wise clicks of a short link for the given date range.

https://api.lnnkin.com/client/api/clicksdata/device
Name Type Description
tracking_id String Unique ID of the short link
start_date String Start date from which the short link clicks count is needed. It must be formatted like "dd/MM/yyyy" , example "01/08/2020".
end_date String End date upto which the short link clicks count is needed. It must be formatted like "dd/MM/yyyy" , example "07/08/2020".

Name Type Description
Content-Type String Content type of the request body. (eg. application/json)
Authorization String API access token of user. It can be found on My Profile page after selecting an API plan.

Name Type Description
success Boolean Its "true" in case of successful response else "false".
tracking_id String Unique ID for the short link.
start_date String Start date from which the short link clicks count is returned.
end_date String Start date upto which the short link clicks count is returned.
short_url String Short link for which the clicks data is returned.
clicks_data Array Array of device wise count of the clicks for the given short link.
error_code String Unique code for occurred error.
error_message String Error description for the occured error.

Sample request & response for DEVICE wise clicks data

    
    // REQUEST HEADERS:
	// POST https://api.lnnkin.com/client/api/clicksdata/device 
	// Content-Type:application/json
	// Authorization:ZPX9blqJm2lJTsYyd9MFiVkb7wsdsudrefvMTz5Ud0UxgbGLua2DCU= 
	
	// REQUEST BODY:
	{ 
		"tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5",
		"start_date":"01/08/2020",
		"end_date":"07/08/2020"
	}

Sample response (Success)

    
{
    "success": true,
    "body": {
        "tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5",
        "start_date":"01/08/2020",
		"end_date":"07/08/2020",
        "short_url": "http://lnnk.in/EIf",
        "clicks_data": [
            {
                "name": "Desktop",
                "clicks": 638
            },
            {
                "name": "Mobile",
                "clicks": 458
            },
            {
                "name": "Tablet",
                "clicks": 232
            }
        ]
    }
}

Sample response (Failure)


	{
 		"success": false,
 		"error_code": "LI11",
 		"error_message": "Invalid tracking ID."
	}	

9. Operating System Wise Clicks

With this API, you will be able to track the Operating System wise clicks of a short link for the given date range.

https://api.lnnkin.com/client/api/clicksdata/os
Name Type Description
tracking_id String Unique ID of the short link
start_date String Start date from which the short link clicks count is needed. It must be formatted like "dd/MM/yyyy" , example "01/08/2020".
end_date String End date upto which the short link clicks count is needed. It must be formatted like "dd/MM/yyyy" , example "07/08/2020".

Name Type Description
Content-Type String Content type of the request body. (eg. application/json)
Authorization String API access token of user. It can be found on My Profile page after selecting an API plan.

Name Type Description
success Boolean Its "true" in case of successful response else "false".
tracking_id String Unique ID for the short link.
start_date String Start date from which the short link clicks count is returned.
end_date String Start date upto which the short link clicks count is returned.
short_url String Short link for which the clicks data is returned.
clicks_data Array Array of operating system wise count of the clicks for the given short link.
error_code String Unique code for occurred error.
error_message String Error description for the occured error.

Sample request & response for OPERATING SYSTEM wise clicks data

    
    // REQUEST HEADERS:
	// POST https://api.lnnkin.com/client/api/clicksdata/os 
	// Content-Type:application/json
	// Authorization:ZPX9blqJm2lJTsYyd9MFiVkb7wsdsudrefvMTz5Ud0UxgbGLua2DCU= 
	
	// REQUEST BODY:
	{ 
		"tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5",
		"start_date":"01/08/2020",
		"end_date":"07/08/2020"
	}

Sample response (Success)

    
{
    "success": true,
    "body": {
        "tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5",
        "start_date":"01/08/2020",
		"end_date":"07/08/2020",
        "short_url": "http://lnnk.in/EIf",
        "clicks_data": [
            {
                "name": "Android",
                "clicks": 642
            },
            {
                "name": "Windows",
                "clicks": 518
            },
            {
                "name": "Mac",
                "clicks": 380
            },
            {
                "name": "Unix",
                "clicks": 260
            },
            {
                "name": "IOS",
                "clicks": 118
            }
        ]
    }
}

Sample response (Failure)


	{
 		"success": false,
 		"error_code": "LI11",
 		"error_message": "Invalid tracking ID."
	}	

10. Browser Wise Clicks

With this API, you will be able to track the Browser wise clicks of a short link for the given date range.

https://api.lnnkin.com/client/api/clicksdata/browser
Name Type Description
tracking_id String Unique ID of the short link
start_date String Start date from which the short link clicks count is needed. It must be formatted like "dd/MM/yyyy" , example "01/08/2020".
end_date String End date upto which the short link clicks count is needed. It must be formatted like "dd/MM/yyyy" , example "07/08/2020".

Name Type Description
Content-Type String Content type of the request body. (eg. application/json)
Authorization String API access token of user. It can be found on My Profile page after selecting an API plan.

Name Type Description
success Boolean Its "true" in case of successful response else "false".
tracking_id String Unique ID for the short link.
start_date String Start date from which the short link clicks count is returned.
end_date String Start date upto which the short link clicks count is returned.
short_url String Short link for which the clicks data is returned.
clicks_data Array Array of browser wise count of the clicks for the given short link.
error_code String Unique code for occurred error.
error_message String Error description for the occured error.

Sample request & response for BROWSER wise clicks data

    
    // REQUEST HEADERS:
	// POST https://api.lnnkin.com/client/api/clicksdata/browser
	// Content-Type:application/json
	// Authorization:ZPX9blqJm2lJTsYyd9MFiVkb7wsdsudrefvMTz5Ud0UxgbGLua2DCU= 
	
	// REQUEST BODY:
	{ 
		"tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5",
		"start_date":"01/08/2020",
		"end_date":"07/08/2020"
	}

Sample response (Success)

    
{
    "success": true,
    "body": {
        "tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5",
        "start_date":"01/08/2020",
		"end_date":"07/08/2020",
        "short_url": "http://lnnk.in/EIf",
        "clicks_data": [
            {
                "name": "Chrome",
                "clicks": 701
            },
            {
                "name": "Safari",
                "clicks": 607
            },
            {
                "name": "Firefox",
                "clicks": 448
            },
            {
                "name": "Other",
                "clicks": 387
            },
            {
                "name": "Opera",
                "clicks": 115
            }
        ]
    }
}

Sample response (Failure)


	{
 		"success": false,
 		"error_code": "LI11",
 		"error_message": "Invalid tracking ID."
	}	

11. Location Wise Clicks

With this API, you will be able to track the Location wise clicks of a short link for the given date range.

https://api.lnnkin.com/client/api/clicksdata/location
Name Type Description
tracking_id String Unique ID of the short link
start_date String Start date from which the short link clicks count is needed. It must be formatted like "dd/MM/yyyy" , example "01/08/2020".
end_date String End date upto which the short link clicks count is needed. It must be formatted like "dd/MM/yyyy" , example "07/08/2020".

Name Type Description
Content-Type String Content type of the request body. (eg. application/json)
Authorization String API access token of user. It can be found on My Profile page after selecting an API plan.

Name Type Description
success Boolean Its "true" in case of successful response else "false".
tracking_id String Unique ID for the short link.
start_date String Start date from which the short link clicks count is returned.
end_date String Start date upto which the short link clicks count is returned.
short_url String Short link for which the clicks data is returned.
clicks_data Array Array of location wise count of the clicks for the given short link.
error_code String Unique code for occurred error.
error_message String Error description for the occured error.

Sample request & response for LOCATION wise clicks data

    
    // REQUEST HEADERS:
	// POST https://api.lnnkin.com/client/api/clicksdata/location
	// Content-Type:application/json
	// Authorization:ZPX9blqJm2lJTsYyd9MFiVkb7wsdsudrefvMTz5Ud0UxgbGLua2DCU= 
	
	// REQUEST BODY:
	{ 
		"tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5",
		"start_date":"01/08/2020",
		"end_date":"07/08/2020"
	}

Sample response (Success)

    
{
    "success": true,
    "body": {
        "tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5",
        "start_date":"01/08/2020",
		"end_date":"07/08/2020",
        "short_url": "http://lnnk.in/EIf",
        "clicks_data": [
           {
                "name": "Canada",
                "clicks": 1140
            },
            {
                "name": "United States",
                "clicks": 586
            },
            {
                "name": "France",
                "clicks": 542
            },
            {
                "name": "India",
                "clicks": 440
            },
            {
                "name": "Philippines",
                "clicks": 382
            },
            {
                "name": "Germany",
                "clicks": 320
            },
            {
                "name": "Italy",
                "clicks": 118
            }
        ]
    }
}

Sample response (Failure)


	{
 		"success": false,
 		"error_code": "LI11",
 		"error_message": "Invalid tracking ID."
	}	

12. Referrer Wise Clicks

With this API, you will be able to track the Referrer wise clicks of a short link for the given date range.

https://api.lnnkin.com/client/api/clicksdata/referrer
Name Type Description
tracking_id String Unique ID of the short link
start_date String Start date from which the short link clicks count is needed. It must be formatted like "dd/MM/yyyy" , example "01/08/2020".
end_date String End date upto which the short link clicks count is needed. It must be formatted like "dd/MM/yyyy" , example "07/08/2020".

Name Type Description
Content-Type String Content type of the request body. (eg. application/json)
Authorization String API access token of user. It can be found on My Profile page after selecting an API plan.

Name Type Description
success Boolean Its "true" in case of successful response else "false".
tracking_id String Unique ID for the short link.
start_date String Start date from which the short link clicks count is returned.
end_date String Start date upto which the short link clicks count is returned.
short_url String Short link for which the clicks data is returned.
clicks_data Array Array of referrer wise count of the clicks for the given short link.
error_code String Unique code for occurred error.
error_message String Error description for the occured error.

Sample request & response for REFERRER wise clicks data

    
    // REQUEST HEADERS:
	// POST https://api.lnnkin.com/client/api/clicksdata/referrer
	// Content-Type:application/json
	// Authorization:ZPX9blqJm2lJTsYyd9MFiVkb7wsdsudrefvMTz5Ud0UxgbGLua2DCU= 
	
	// REQUEST BODY:
	{ 
		"tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5",
		"start_date":"01/08/2020",
		"end_date":"07/08/2020"
	}

Sample response (Success)

    
{
    "success": true,
    "body": {
        "tracking_id": "ab2005c2-9c60-4e61-a36e-a44e51c1ede5",
        "start_date":"01/08/2020",
		"end_date":"07/08/2020",
        "short_url": "http://lnnk.in/EIf",
        "clicks_data": [
            {
                "name": "m.facebook.com",
                "clicks": 1166
            },
            {
                "name": "com.linkedin.android",
                "clicks": 794
            },
            {
                "name": "t.co",
                "clicks": 677
            },
            {
                "name": "Other",
                "clicks": 502
            },
            {
                "name": "mobile.facebook.com",
                "clicks": 233
            },
            {
                "name": "l.instagram.com",
                "clicks": 201
            },
            {
                "name": "google.com",
                "clicks": 111
            },
            {
                "name": "www.quora.com",
                "clicks": 84
            }
        ]
    }
}

Sample response (Failure)


	{
 		"success": false,
 		"error_code": "LI11",
 		"error_message": "Invalid tracking ID."
	}	

13. Response Error codes

Error code Error message
LI00 Invalid request.
LI01 Per second limit exceeded.
LI02 Monthly limit exceeded.
LI03 Unauthorized access.
LI04 Please select a plan from www.lnnkin.com which supports API access
LI05 Invalid destination link.
LI06 Invalid custom name. Only alphabets, numbers, underscore and hyphen are allowed.
LI07 Custom name already taken. Try something else.
LI08 Unable to generate short URL. Please try again.
LI09 Unable to generate custom URL. Please try again.
LI10 Email not verified.
LI11 Invalid tracking ID.
LI12 Short URL edit not allowed.
LI13 This domain is blacklisted in our system. Please read our terms of use.
LI14 Invalid custom domain.
LI15 Invalid start or end date.
LI16 Invalid short URL.

This website uses cookies to ensure you get the best experience with our service. By continuing to use this site, you agree to our Privacy Policy.