Introduction
T.LY URL Shortener API documentation to create URLs to track, brand, and share short links. This documentation aims to provide all the information you need to work with our API. Please contact [email protected] if you have any issues.
API docs for T.LY.
Base URL
https://api.t.ly
Authenticating requests
Authenticate requests to this API's endpoints by sending an Authorization header api_token
in the request.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
Please sign in and generate an API Token to begin using the API.
Pixel Management
APIs for managing pixels
Create Pixel
requires authentication
Example request:
curl --request POST \
"https://api.t.ly/api/v1/link/pixel" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"GTMPixel\",
\"pixel_id\": \"GTM-xxxx\",
\"pixel_type\": \"googleTagManager\"
}"
const url = new URL(
"https://api.t.ly/api/v1/link/pixel"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "GTMPixel",
"pixel_id": "GTM-xxxx",
"pixel_type": "googleTagManager"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.t.ly/api/v1/link/pixel',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'GTMPixel',
'pixel_id' => 'GTM-xxxx',
'pixel_type' => 'googleTagManager',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/pixel'
payload = {
"name": "GTMPixel",
"pixel_id": "GTM-xxxx",
"pixel_type": "googleTagManager"
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"id": 12345,
"name": "GTMPixel",
"pixel_id": "GTM-xxxx",
"pixel_type": "googleTagManager",
"created_at": "2024-01-16T19:32:20.000000Z",
"updated_at": "2024-01-16T19:32:20.000000Z"
}
Received response:
Request failed with error:
List Pixel
requires authentication
Example request:
curl --request GET \
--get "https://api.t.ly/api/v1/link/pixel" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.t.ly/api/v1/link/pixel"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.t.ly/api/v1/link/pixel',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/pixel'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
[
{
"id": 12345,
"name": "GTM Pixel",
"pixel_id": "GTM-xxxx",
"pixel_type": "googleTagManager",
"created_at": "2024-01-16T19:32:20.000000Z",
"updated_at": "2024-01-16T19:32:20.000000Z"
}
]
Received response:
Request failed with error:
Get Pixel
requires authentication
Example request:
curl --request GET \
--get "https://api.t.ly/api/v1/link/pixel/12345" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.t.ly/api/v1/link/pixel/12345"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.t.ly/api/v1/link/pixel/12345',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/pixel/12345'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"id": 12345,
"name": "GTMPixel",
"pixel_id": "GTM-xxxx",
"pixel_type": "googleTagManager",
"created_at": "2024-01-16T19:32:20.000000Z",
"updated_at": "2024-01-16T19:32:20.000000Z"
}
Received response:
Request failed with error:
Update Pixel
requires authentication
Example request:
curl --request PUT \
"https://api.t.ly/api/v1/link/pixel/repellat" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 12345,
\"name\": \"GTMPixel\",
\"pixel_id\": \"GTM-xxxx\",
\"pixel_type\": \"googleTagManager\"
}"
const url = new URL(
"https://api.t.ly/api/v1/link/pixel/repellat"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 12345,
"name": "GTMPixel",
"pixel_id": "GTM-xxxx",
"pixel_type": "googleTagManager"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://api.t.ly/api/v1/link/pixel/repellat',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'id' => 12345,
'name' => 'GTMPixel',
'pixel_id' => 'GTM-xxxx',
'pixel_type' => 'googleTagManager',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/pixel/repellat'
payload = {
"id": 12345,
"name": "GTMPixel",
"pixel_id": "GTM-xxxx",
"pixel_type": "googleTagManager"
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"id": 12345,
"name": "GTMPixel",
"pixel_id": "GTM-xxxx",
"pixel_type": "googleTagManager",
"created_at": "2024-01-16T19:32:20.000000Z",
"updated_at": "2024-01-16T19:32:20.000000Z"
}
Received response:
Request failed with error:
Delete Pixel
requires authentication
Example request:
curl --request DELETE \
"https://api.t.ly/api/v1/link/pixel/12345" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.t.ly/api/v1/link/pixel/12345"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://api.t.ly/api/v1/link/pixel/12345',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/pixel/12345'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
Example response (202):
{}
Received response:
Request failed with error:
Short Link Management
APIs for managing short links
Create Short Link
requires authentication
Example request:
curl --request POST \
"https://api.t.ly/api/v1/link/shorten" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"long_url\": \"http:\\/\\/example.com\\/\",
\"domain\": \"https:\\/\\/t.ly\\/\",
\"expire_at_datetime\": \"2035-01-17 15:00:00\",
\"description\": \"Social Media Link\",
\"public_stats\": true,
\"meta\": {
\"smart_urls\": [
{
\"type\": \"US\",
\"url\": \"usa.com\"
},
{
\"type\": \"iPhone\",
\"url\": \"apple.com\"
}
]
}
}"
const url = new URL(
"https://api.t.ly/api/v1/link/shorten"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"long_url": "http:\/\/example.com\/",
"domain": "https:\/\/t.ly\/",
"expire_at_datetime": "2035-01-17 15:00:00",
"description": "Social Media Link",
"public_stats": true,
"meta": {
"smart_urls": [
{
"type": "US",
"url": "usa.com"
},
{
"type": "iPhone",
"url": "apple.com"
}
]
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.t.ly/api/v1/link/shorten',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
$o = [
clone (($p = &\Symfony\Component\VarExporter\Internal\Registry::$prototypes)['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
clone $p['stdClass'],
clone $p['stdClass'],
],
null,
[
'stdClass' => [
'smart_urls' => [
[
$o[1],
$o[2],
],
],
'type' => [
1 => 'US',
'iPhone',
],
'url' => [
1 => 'usa.com',
'apple.com',
],
],
],
[
'long_url' => 'http://example.com/',
'domain' => 'https://t.ly/',
'expire_at_datetime' => '2035-01-17 15:00:00',
'description' => 'Social Media Link',
'public_stats' => true,
'meta' => $o[0],
],
[]
),
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/shorten'
payload = {
"long_url": "http:\/\/example.com\/",
"domain": "https:\/\/t.ly\/",
"expire_at_datetime": "2035-01-17 15:00:00",
"description": "Social Media Link",
"public_stats": true,
"meta": {
"smart_urls": [
{
"type": "US",
"url": "usa.com"
},
{
"type": "iPhone",
"url": "apple.com"
}
]
}
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"short_url": "https://t.ly/c55j",
"description": null,
"long_url": "https://weatherextension.com/",
"domain": "https://t.ly/",
"short_id": "c55j",
"expire_at_views": null,
"expire_at_datetime": null,
"public_stats": false,
"created_at": "2022-01-16T19:32:20.000000Z",
"updated_at": "2022-01-16T19:32:20.000000Z",
"meta": {
"smart_urls": [
{
"type": "US",
"url": "usa.com"
},
{
"type": "iPhone",
"url": "apple.com"
}
]
}
}
Received response:
Request failed with error:
Get Short Link
requires authentication
Example request:
curl --request GET \
--get "https://api.t.ly/api/v1/link?short_url=https%3A%2F%2Ft.ly%2Fc55j" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.t.ly/api/v1/link"
);
const params = {
"short_url": "https://t.ly/c55j",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.t.ly/api/v1/link',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'short_url'=> 'https://t.ly/c55j',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link'
params = {
'short_url': 'https://t.ly/c55j',
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (200):
{
"short_url": "https://t.ly/c55j",
"long_url": "https://weatherextension.com/",
"domain": "https://t.ly/",
"short_id": "c55j",
"expire_at_views": null,
"expire_at_datetime": null,
"public_stats": false,
"qr_code_url": "https://t.ly/qr?url=https://t.ly/c55j",
"qr_code_base64": "data:image/png;base64,iVBORw0KGgoA..."
"tags": []
"pixels": []
}
Received response:
Request failed with error:
Update Short Link
requires authentication
Example request:
curl --request PUT \
"https://api.t.ly/api/v1/link" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"short_url\": \"https:\\/\\/t.ly\\/OYXL\",
\"long_url\": \"https:\\/\\/weatherextension.com\\/\",
\"expire_at_datetime\": \"2035-01-17 15:00:00\",
\"description\": \"Social Media Link\",
\"public_stats\": true,
\"meta\": {
\"smart_urls\": [
{
\"type\": \"US\",
\"url\": \"usa.com\"
},
{
\"type\": \"iPhone\",
\"url\": \"apple.com\"
}
]
}
}"
const url = new URL(
"https://api.t.ly/api/v1/link"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"short_url": "https:\/\/t.ly\/OYXL",
"long_url": "https:\/\/weatherextension.com\/",
"expire_at_datetime": "2035-01-17 15:00:00",
"description": "Social Media Link",
"public_stats": true,
"meta": {
"smart_urls": [
{
"type": "US",
"url": "usa.com"
},
{
"type": "iPhone",
"url": "apple.com"
}
]
}
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://api.t.ly/api/v1/link',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
$o = [
clone (($p = &\Symfony\Component\VarExporter\Internal\Registry::$prototypes)['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
clone $p['stdClass'],
clone $p['stdClass'],
],
null,
[
'stdClass' => [
'smart_urls' => [
[
$o[1],
$o[2],
],
],
'type' => [
1 => 'US',
'iPhone',
],
'url' => [
1 => 'usa.com',
'apple.com',
],
],
],
[
'short_url' => 'https://t.ly/OYXL',
'long_url' => 'https://weatherextension.com/',
'expire_at_datetime' => '2035-01-17 15:00:00',
'description' => 'Social Media Link',
'public_stats' => true,
'meta' => $o[0],
],
[]
),
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link'
payload = {
"short_url": "https:\/\/t.ly\/OYXL",
"long_url": "https:\/\/weatherextension.com\/",
"expire_at_datetime": "2035-01-17 15:00:00",
"description": "Social Media Link",
"public_stats": true,
"meta": {
"smart_urls": [
{
"type": "US",
"url": "usa.com"
},
{
"type": "iPhone",
"url": "apple.com"
}
]
}
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"short_url": "https://t.ly/c55j",
"description": null,
"long_url": "https://weatherextension.com/",
"domain": "https://t.ly/",
"short_id": "c55j",
"expire_at_views": null,
"expire_at_datetime": null,
"public_stats": false,
"created_at": "2022-01-16T19:32:20.000000Z",
"updated_at": "2022-01-16T19:32:20.000000Z",
"meta": {
"smart_urls": [
{
"type": "US",
"url": "usa.com"
},
{
"type": "iPhone",
"url": "apple.com"
}
]
}
}
Received response:
Request failed with error:
Delete Short Link
requires authentication
Example request:
curl --request DELETE \
"https://api.t.ly/api/v1/link" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"short_url\": \"https:\\/\\/t.ly\\/OYXL\"
}"
const url = new URL(
"https://api.t.ly/api/v1/link"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"short_url": "https:\/\/t.ly\/OYXL"
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://api.t.ly/api/v1/link',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'short_url' => 'https://t.ly/OYXL',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link'
payload = {
"short_url": "https:\/\/t.ly\/OYXL"
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers, json=payload)
response.json()
Example response (202):
{}
Received response:
Request failed with error:
Expand Short Link
requires authentication
Example request:
curl --request POST \
"https://api.t.ly/api/v1/link/expand" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"short_url\": \"https:\\/\\/t.ly\\/OYXL\",
\"password\": \"password123\"
}"
const url = new URL(
"https://api.t.ly/api/v1/link/expand"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"short_url": "https:\/\/t.ly\/OYXL",
"password": "password123"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.t.ly/api/v1/link/expand',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'short_url' => 'https://t.ly/OYXL',
'password' => 'password123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/expand'
payload = {
"short_url": "https:\/\/t.ly\/OYXL",
"password": "password123"
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"long_url": "http: //example.com/",
"expired": false
}
Received response:
Request failed with error:
List Short Links
requires authentication
Example request:
curl --request GET \
--get "https://api.t.ly/api/v1/link/list?search=amazon&tag_ids[]=1&pixel_ids[]=1&start_date=2035-01-17+15%3A00%3A00&end_date=2037-01-17+15%3A00%3A00&domains[]=1" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.t.ly/api/v1/link/list"
);
const params = {
"search": "amazon",
"tag_ids[]": "1",
"pixel_ids[]": "1",
"start_date": "2035-01-17 15:00:00",
"end_date": "2037-01-17 15:00:00",
"domains[]": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.t.ly/api/v1/link/list',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'search'=> 'amazon',
'tag_ids[]'=> '1',
'pixel_ids[]'=> '1',
'start_date'=> '2035-01-17 15:00:00',
'end_date'=> '2037-01-17 15:00:00',
'domains[]'=> '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/list'
params = {
'search': 'amazon',
'tag_ids[]': '1',
'pixel_ids[]': '1',
'start_date': '2035-01-17 15:00:00',
'end_date': '2037-01-17 15:00:00',
'domains[]': '1',
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (200):
{
"current_page": 1,
"data": [
{
"description": null,
"long_url": "https:\/\/google.com\/",
"short_url": "https:\/\/t.ly\/1234",
"domain": "https:\/\/t.ly\/",
"short_id": "1234",
"user_id": 1,
"team_id": 1,
"domain_id": null,
"expire_at_datetime": null,
"expire_at_views": null,
"public_stats": false,
"meta": {
"smart_urls": []
},
"created_at": "2024-03-12T13:24:52.000000Z",
"updated_at": "2024-03-12T13:24:52.000000Z",
"has_password": false,
"short_stats": {},
"user": {
"id": 1,
"name": "Tim",
"email": "[email protected]",
},
"qr_code": null,
"tags": [],
"pixels": []
}
]
}
Received response:
Request failed with error:
Bulk Shorten Links
requires authentication
Example request:
curl --request POST \
"https://api.t.ly/api/v1/link/bulk" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"domain\": \"https:\\/\\/t.ly\\/\",
\"links\": \"[{LongUrl: \'google.com\', Backhalf: \'123\', Password: \'123\', Description: \'Short Link Description\' }]\",
\"tags\": [
1,
2,
3
],
\"pixels\": [
1,
2,
3
]
}"
const url = new URL(
"https://api.t.ly/api/v1/link/bulk"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"domain": "https:\/\/t.ly\/",
"links": "[{LongUrl: 'google.com', Backhalf: '123', Password: '123', Description: 'Short Link Description' }]",
"tags": [
1,
2,
3
],
"pixels": [
1,
2,
3
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.t.ly/api/v1/link/bulk',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'domain' => 'https://t.ly/',
'links' => '[{LongUrl: \'google.com\', Backhalf: \'123\', Password: \'123\', Description: \'Short Link Description\' }]',
'tags' => [
1,
2,
3,
],
'pixels' => [
1,
2,
3,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/bulk'
payload = {
"domain": "https:\/\/t.ly\/",
"links": "[{LongUrl: 'google.com', Backhalf: '123', Password: '123', Description: 'Short Link Description' }]",
"tags": [
1,
2,
3
],
"pixels": [
1,
2,
3
]
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
true
}
Received response:
Request failed with error:
Stats Management
APIs for managing stats
Stats
requires authentication
Example request:
curl --request GET \
--get "https://api.t.ly/api/v1/link/stats?short_url=https%3A%2F%2Ft.ly%2FOYXL" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.t.ly/api/v1/link/stats"
);
const params = {
"short_url": "https://t.ly/OYXL",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.t.ly/api/v1/link/stats',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'short_url'=> 'https://t.ly/OYXL',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/stats'
params = {
'short_url': 'https://t.ly/OYXL',
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (200):
{
"clicks": 0,
"unique_clicks": 0,
"browsers": [],
"countries": [],
"referrers": [],
"platforms": [],
"daily_clicks": [],
"data": {
"description": null,
"long_url": "https://weatherextension.com/",
"short_url": "https://t.ly/c55j",
"created_at": "2022-01-16T19:10:36.000000Z"
}
}
Received response:
Request failed with error:
Tag Management
APIs for managing tags
List Tag
requires authentication
Example request:
curl --request GET \
--get "https://api.t.ly/api/v1/link/tag" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.t.ly/api/v1/link/tag"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.t.ly/api/v1/link/tag',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/tag'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
[
{
"id": 12345,
"tag": "fall2024",
"created_at": "2024-01-16T19:32:20.000000Z",
"updated_at": "2024-01-16T19:32:20.000000Z"
}
]
Received response:
Request failed with error:
Create Tag
requires authentication
Example request:
curl --request POST \
"https://api.t.ly/api/v1/link/tag" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"tag\": \"fall2024\"
}"
const url = new URL(
"https://api.t.ly/api/v1/link/tag"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"tag": "fall2024"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.t.ly/api/v1/link/tag',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'tag' => 'fall2024',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/tag'
payload = {
"tag": "fall2024"
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"id": 12345,
"tag": "fall2024",
"created_at": "2024-01-16T19:32:20.000000Z",
"updated_at": "2024-01-16T19:32:20.000000Z"
}
Received response:
Request failed with error:
Get Tag
requires authentication
Example request:
curl --request GET \
--get "https://api.t.ly/api/v1/link/tag/12345" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.t.ly/api/v1/link/tag/12345"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.t.ly/api/v1/link/tag/12345',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/tag/12345'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"id": 12345,
"tag": "fall2024",
"created_at": "2025-01-16T19:32:20.000000Z",
"updated_at": "2025-01-16T19:32:20.000000Z"
}
Received response:
Request failed with error:
Update Tag
requires authentication
Example request:
curl --request PUT \
"https://api.t.ly/api/v1/link/tag/12345" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"tag\": \"fall2025\"
}"
const url = new URL(
"https://api.t.ly/api/v1/link/tag/12345"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"tag": "fall2025"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://api.t.ly/api/v1/link/tag/12345',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'tag' => 'fall2025',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/tag/12345'
payload = {
"tag": "fall2025"
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"id": 12345,
"tag": "fall2025",
"created_at": "2025-01-16T19:32:20.000000Z",
"updated_at": "2025-01-16T19:32:20.000000Z"
}
Received response:
Request failed with error:
Delete Tag
requires authentication
Example request:
curl --request DELETE \
"https://api.t.ly/api/v1/link/tag/12345" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.t.ly/api/v1/link/tag/12345"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://api.t.ly/api/v1/link/tag/12345',
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.t.ly/api/v1/link/tag/12345'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
Example response (202):
{}
Received response:
Request failed with error: