Developers
Short Link and QR Code API Reference
Every request needs an API key. API access depends on your plan. If your plan includes it, your key is shown under Getting Started when you are signed in. If it does not, requests return the error "You do not have the permission to use the API."
Getting Started
Send your API key with every request (see the examples under Authentication). If the key is missing or has expired, the API returns an error. Keep your key secret to prevent misuse.
Authentication
To authenticate, send your API key as a Bearer token in the Authorization header of every request. The examples below call the Get Account endpoint.
curl --location --request GET 'https://shorturl.is/api/account' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/account', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/account"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://shorturl.is/api/account");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Rate Limit
The API limits how many requests you can make, which keeps it stable during spikes in traffic. The current limit is 30 requests per 1-minute window. The limit can vary by plan.
Each response includes headers that show your limit, the requests you have left and the time the limit resets, as a Unix timestamp.
X-RateLimit-Limit: 30X-RateLimit-Remaining: 29X-RateLimit-Reset: TIMESTAMP
Response Handling
All API responses are returned as JSON. To use the data, parse it with the JSON function for your language. In PHP, json_decode() returns an object by default, or an array if you set the second parameter to true. Always check the error key: it tells you whether the request failed. You can also check the HTTP status code.
{
"error": 1,
"message": "An error occurred"
}
Get Account
https://shorturl.is/api/account
Get information about your account.
curl --location --request GET 'https://shorturl.is/api/account' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/account', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/account"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://shorturl.is/api/account");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"data": {
"id": 1,
"email": "[email protected]",
"username": "sampleuser",
"avatar": "https:\/\/domain.com\/content\/avatar.png",
"status": "pro",
"expires": "2022-11-15 15:00:00",
"registered": "2020-11-10 18:01:43"
}
}
Update Account
https://shorturl.is/api/account/update
Update your account details. Send the new values as JSON in the body of a PUT request.
curl --location --request PUT 'https://shorturl.is/api/account/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
"password": "NewPassword1"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/account/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{
"email": "[email protected]",
"password": "NewPassword1"
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/account/update', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"email": "[email protected]",
"password": "NewPassword1"
})
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/account/update"
payload = """{
"email": "[email protected]",
"password": "NewPassword1"
}"""
headers = {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://shorturl.is/api/account/update");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
request.Content = new StringContent("""
{
"email": "[email protected]",
"password": "NewPassword1"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"message": "Account has been successfully updated."
}
List Branded Domains
https://shorturl.is/api/domains?limit=2&page=1
Get your branded domains. Use the parameters below to choose the page and the number of results per page.
| Parameter | Description |
|---|---|
| limit | (optional) Number of results per page |
| page | (optional) Page number to return |
curl --location --request GET 'https://shorturl.is/api/domains?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/domains?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/domains?limit=2&page=1', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/domains?limit=2&page=1"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://shorturl.is/api/domains?limit=2&page=1");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"domains": [
{
"id": 1,
"domain": "https:\/\/domain1.com",
"redirectroot": "https:\/\/rootdomain.com",
"redirect404": "https:\/\/rootdomain.com\/404"
},
{
"id": 2,
"domain": "https:\/\/domain2.com",
"redirectroot": "https:\/\/rootdomain2.com",
"redirect404": "https:\/\/rootdomain2.com\/404"
}
]
}
}
Create a Branded Domain
https://shorturl.is/api/domain/add
Add a branded domain. The domain must already point to our server.
| Parameter | Description |
|---|---|
| domain | (required) The branded domain, including http:// or https:// |
| redirectroot | (optional) URL to redirect to when someone visits the root of your domain |
| redirect404 | (optional) URL to redirect to instead of showing a 404 (page not found) error |
curl --location --request POST 'https://shorturl.is/api/domain/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"domain": "https://domain1.com",
"redirectroot": "https://rootdomain.com",
"redirect404": "https://rootdomain.com/404"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/domain/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{
"domain": "https://domain1.com",
"redirectroot": "https://rootdomain.com",
"redirect404": "https://rootdomain.com/404"
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/domain/add', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"domain": "https://domain1.com",
"redirectroot": "https://rootdomain.com",
"redirect404": "https://rootdomain.com/404"
})
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/domain/add"
payload = """{
"domain": "https://domain1.com",
"redirectroot": "https://rootdomain.com",
"redirect404": "https://rootdomain.com/404"
}"""
headers = {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://shorturl.is/api/domain/add");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
request.Content = new StringContent("""
{
"domain": "https://domain1.com",
"redirectroot": "https://rootdomain.com",
"redirect404": "https://rootdomain.com/404"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"id": 1
}
Update Domain
https://shorturl.is/api/domain/:id/update
To update a branded domain, send a PUT request with the data as JSON in the raw body, as shown in the example. The example includes every parameter you can send. You do not have to send them all: the table shows which are required.
| Parameter | Description |
|---|---|
| redirectroot | (optional) URL to redirect to when someone visits the root of your domain |
| redirect404 | (optional) URL to redirect to instead of showing a 404 (page not found) error |
curl --location --request PUT 'https://shorturl.is/api/domain/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"redirectroot": "https://rootdomain-new.com",
"redirect404": "https://rootdomain-new.com/404"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/domain/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{
"redirectroot": "https://rootdomain-new.com",
"redirect404": "https://rootdomain-new.com/404"
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/domain/:id/update', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"redirectroot": "https://rootdomain-new.com",
"redirect404": "https://rootdomain-new.com/404"
})
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/domain/:id/update"
payload = """{
"redirectroot": "https://rootdomain-new.com",
"redirect404": "https://rootdomain-new.com/404"
}"""
headers = {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://shorturl.is/api/domain/:id/update");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
request.Content = new StringContent("""
{
"redirectroot": "https://rootdomain-new.com",
"redirect404": "https://rootdomain-new.com/404"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"message": "Domain has been updated successfully."
}
Delete Domain
https://shorturl.is/api/domain/:id/delete
To delete a domain, you need to send a DELETE request.
curl --location --request DELETE 'https://shorturl.is/api/domain/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/domain/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/domain/:id/delete', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/domain/:id/delete"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("DELETE", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Delete, "https://shorturl.is/api/domain/:id/delete");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"message": "Domain has been deleted successfully."
}
List CTA Overlays
https://shorturl.is/api/overlay?limit=2&page=1
Get your CTA overlays. Use the parameters below to choose the page and the number of results per page.
| Parameter | Description |
|---|---|
| limit | (optional) Number of results per page |
| page | (optional) Page number to return |
curl --location --request GET 'https://shorturl.is/api/overlay?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/overlay?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/overlay?limit=2&page=1', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/overlay?limit=2&page=1"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://shorturl.is/api/overlay?limit=2&page=1");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"cta": [
{
"id": 1,
"type": "message",
"name": "Product 1 Promo",
"date": "2020-11-10 18:00:00"
},
{
"id": 2,
"type": "contact",
"name": "Contact Page",
"date": "2020-11-10 18:10:00"
}
]
}
}
List Campaigns
https://shorturl.is/api/campaigns?limit=2&page=1
Get your campaigns. Use the parameters below to choose the page and the number of results per page.
| Parameter | Description |
|---|---|
| limit | (optional) Number of results per page |
| page | (optional) Page number to return |
curl --location --request GET 'https://shorturl.is/api/campaigns?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/campaigns?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/campaigns?limit=2&page=1', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/campaigns?limit=2&page=1"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://shorturl.is/api/campaigns?limit=2&page=1");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"campaigns": [
{
"id": 1,
"name": "Sample Campaign",
"rotator": false
},
{
"id": 2,
"domain": "Facebook Campaign",
"rotator": "https:\/\/domain.com\/r\/test"
}
]
}
}
Create a Campaign
https://shorturl.is/api/campaign/add
Create a campaign.
| Parameter | Description |
|---|---|
| name | (optional) Campaign name |
| slug | (optional) Slug used in the campaign's rotator link |
curl --location --request POST 'https://shorturl.is/api/campaign/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "New Campaign",
"slug": "new-campaign"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/campaign/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{
"name": "New Campaign",
"slug": "new-campaign"
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/campaign/add', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "New Campaign",
"slug": "new-campaign"
})
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/campaign/add"
payload = """{
"name": "New Campaign",
"slug": "new-campaign"
}"""
headers = {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://shorturl.is/api/campaign/add");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
request.Content = new StringContent("""
{
"name": "New Campaign",
"slug": "new-campaign"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"id": 3,
"domain": "New Campaign",
"rotator": "https:\/\/domain.com\/r\/new-campaign"
}
Assign a Link to a Campaign
https://shorturl.is/api/campaign/:campaignid/assign/:linkid
Add a short link to a campaign. The route needs the campaign ID and the short link ID.
curl --location --request POST 'https://shorturl.is/api/campaign/:campaignid/assign/:linkid' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/campaign/:campaignid/assign/:linkid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/campaign/:campaignid/assign/:linkid', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/campaign/:campaignid/assign/:linkid"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("POST", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://shorturl.is/api/campaign/:campaignid/assign/:linkid");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"message": "Link successfully added to the campaign."
}
Update Campaign
https://shorturl.is/api/campaign/:id/update
To update a campaign, send a PUT request with the data as JSON in the raw body, as shown in the example. The example includes every parameter you can send. You do not have to send them all: the table shows which are required.
| Parameter | Description |
|---|---|
| name | (required) Campaign name |
| slug | (optional) Slug used in the campaign's rotator link |
curl --location --request PUT 'https://shorturl.is/api/campaign/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Twitter Campaign",
"slug": "twitter-campaign"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/campaign/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{
"name": "Twitter Campaign",
"slug": "twitter-campaign"
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/campaign/:id/update', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Twitter Campaign",
"slug": "twitter-campaign"
})
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/campaign/:id/update"
payload = """{
"name": "Twitter Campaign",
"slug": "twitter-campaign"
}"""
headers = {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://shorturl.is/api/campaign/:id/update");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
request.Content = new StringContent("""
{
"name": "Twitter Campaign",
"slug": "twitter-campaign"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"id": 3,
"domain": "Twitter Campaign",
"rotator": "https:\/\/domain.com\/r\/twitter-campaign"
}
Delete Campaign
https://shorturl.is/api/campaign/:id/delete
To delete a campaign, you need to send a DELETE request.
curl --location --request DELETE 'https://shorturl.is/api/campaign/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/campaign/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/campaign/:id/delete', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/campaign/:id/delete"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("DELETE", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Delete, "https://shorturl.is/api/campaign/:id/delete");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"message": "Campaign has been deleted successfully."
}
List Channels
https://shorturl.is/api/channels?limit=2&page=1
Get your channels. Use the parameters below to choose the page and the number of results per page.
| Parameter | Description |
|---|---|
| limit | (optional) Number of results per page |
| page | (optional) Page number to return |
curl --location --request GET 'https://shorturl.is/api/channels?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/channels?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/channels?limit=2&page=1', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/channels?limit=2&page=1"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://shorturl.is/api/channels?limit=2&page=1");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"channels": [
{
"id": 1,
"name": "Channel 1",
"description": "Description of channel 1",
"color": "#000000",
"starred": true
},
{
"id": 2,
"name": "Channel 2",
"description": "Description of channel 2",
"color": "#FF0000",
"starred": false
}
]
}
}
List Channel Items
https://shorturl.is/api/channel/:id?limit=1&page=1
Get the items in one of your channels. Use the parameters below to choose the page and the number of results per page.
| Parameter | Description |
|---|---|
| limit | (optional) Number of results per page |
| page | (optional) Page number to return |
curl --location --request GET 'https://shorturl.is/api/channel/:id?limit=1&page=1' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/channel/:id?limit=1&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/channel/:id?limit=1&page=1', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/channel/:id?limit=1&page=1"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://shorturl.is/api/channel/:id?limit=1&page=1");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"items": [
{
"type": "links",
"id": 1,
"title": "My Sample Link",
"preview": "https:\/\/google.com",
"link": "https:\/\/shorturl.is\/google",
"date": "2022-05-12"
},
{
"type": "bio",
"id": 1,
"title": "My Sample Bio",
"preview": "https:\/\/shorturl.is\/mybio",
"link": "https:\/\/shorturl.is\/mybio",
"date": "2022-06-01"
}
]
}
}
Create a Channel
https://shorturl.is/api/channel/add
Create a channel.
| Parameter | Description |
|---|---|
| name | (required) Channel name |
| description | (optional) Channel description |
| color | (optional) Channel badge colour as a hex code, for example #FF0000 |
| starred | (optional) true to star the channel, false to leave it unstarred |
curl --location --request POST 'https://shorturl.is/api/channel/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "New Channel",
"description": "my new channel",
"color": "#000000",
"starred": true
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/channel/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{
"name": "New Channel",
"description": "my new channel",
"color": "#000000",
"starred": true
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/channel/add', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "New Channel",
"description": "my new channel",
"color": "#000000",
"starred": true
})
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/channel/add"
payload = """{
"name": "New Channel",
"description": "my new channel",
"color": "#000000",
"starred": true
}"""
headers = {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://shorturl.is/api/channel/add");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
request.Content = new StringContent("""
{
"name": "New Channel",
"description": "my new channel",
"color": "#000000",
"starred": true
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"id": 3,
"name": "New Channel",
"description": "my new channel",
"color": "#000000",
"starred": true
}
Assign an Item to a Channel
https://shorturl.is/api/channel/:channelid/assign/:type/:itemid
Add an item to a channel. The route needs the channel ID, the item type (links, bio or qr) and the item ID.
| Parameter | Description |
|---|---|
| :channelid | (required) Channel ID |
| :type | (required) The item type: links, bio or qr |
| :itemid | (required) Item ID |
curl --location --request POST 'https://shorturl.is/api/channel/:channelid/assign/:type/:itemid' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/channel/:channelid/assign/:type/:itemid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/channel/:channelid/assign/:type/:itemid', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/channel/:channelid/assign/:type/:itemid"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("POST", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://shorturl.is/api/channel/:channelid/assign/:type/:itemid");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"message": "Item successfully added to the channel."
}
Update Channel
https://shorturl.is/api/channel/:id/update
To update a channel, send a PUT request with the data as JSON in the raw body, as shown in the example. The example includes every parameter you can send. You do not have to send them all: the table shows which are required.
| Parameter | Description |
|---|---|
| name | (optional) Channel name |
| description | (optional) Channel description |
| color | (optional) Channel badge colour as a hex code, for example #FF0000 |
| starred | (optional) true to star the channel, false to leave it unstarred |
curl --location --request PUT 'https://shorturl.is/api/channel/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Acme Corp",
"description": "channel for items for Acme Corp",
"color": "#FFFFFF",
"starred": false
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/channel/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{
"name": "Acme Corp",
"description": "channel for items for Acme Corp",
"color": "#FFFFFF",
"starred": false
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/channel/:id/update', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Acme Corp",
"description": "channel for items for Acme Corp",
"color": "#FFFFFF",
"starred": false
})
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/channel/:id/update"
payload = """{
"name": "Acme Corp",
"description": "channel for items for Acme Corp",
"color": "#FFFFFF",
"starred": false
}"""
headers = {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://shorturl.is/api/channel/:id/update");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
request.Content = new StringContent("""
{
"name": "Acme Corp",
"description": "channel for items for Acme Corp",
"color": "#FFFFFF",
"starred": false
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"message": "Channel has been updated successfully."
}
Delete Channel
https://shorturl.is/api/channel/:id/delete
To delete a channel, send a DELETE request. Every item in the channel is unassigned from it.
curl --location --request DELETE 'https://shorturl.is/api/channel/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/channel/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/channel/:id/delete', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/channel/:id/delete"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("DELETE", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Delete, "https://shorturl.is/api/channel/:id/delete");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"message": "Channel has been deleted successfully."
}
List Custom Splash
https://shorturl.is/api/splash?limit=2&page=1
Get your custom splash pages. Use the parameters below to choose the page and the number of results per page.
| Parameter | Description |
|---|---|
| limit | (optional) Number of results per page |
| page | (optional) Page number to return |
curl --location --request GET 'https://shorturl.is/api/splash?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/splash?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/splash?limit=2&page=1', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/splash?limit=2&page=1"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://shorturl.is/api/splash?limit=2&page=1");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"splash": [
{
"id": 1,
"name": "Product 1 Promo",
"date": "2020-11-10 18:00:00"
},
{
"id": 2,
"name": "Product 2 Promo",
"date": "2020-11-10 18:10:00"
}
]
}
}
List Links
https://shorturl.is/api/urls?limit=2&page=1&order=date
Get your links. Use the parameters below to choose the page, the sort order or a search term.
| Parameter | Description |
|---|---|
| limit | (optional) Number of results per page |
| page | (optional) Page number to return |
| order | (optional) Sort order: date or click |
| short | (optional) Search by short URL. When you use this parameter, all other parameters are ignored. If there is a match, the response has the same format as Get a Single Link. |
| q | (optional) Search for links using a keyword |
curl --location --request GET 'https://shorturl.is/api/urls?limit=2&page=1&order=date' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/urls?limit=2&page=1&order=date",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/urls?limit=2&page=1&order=date', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/urls?limit=2&page=1&order=date"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://shorturl.is/api/urls?limit=2&page=1&order=date");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"urls": [
{
"id": 2,
"alias": "google",
"shorturl": "https:\/\/shorturl.is\/google",
"longurl": "https:\/\/google.com",
"clicks": 0,
"title": "Google",
"description": "",
"date": "2020-11-10 18:01:43"
},
{
"id": 1,
"alias": "googlecanada",
"shorturl": "https:\/\/shorturl.is\/googlecanada",
"longurl": "https:\/\/google.ca",
"clicks": 0,
"title": "Google Canada",
"description": "",
"date": "2020-11-10 18:00:25"
}
]
}
}
Get a Single Link
https://shorturl.is/api/url/:id
Get the details of a single link.
curl --location --request GET 'https://shorturl.is/api/url/:id' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/url/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/url/:id', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/url/:id"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://shorturl.is/api/url/:id");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"id": 1,
"details": {
"id": 1,
"shorturl": "https:\/\/shorturl.is\/googlecanada",
"longurl": "https:\/\/google.com",
"title": "Google",
"description": "",
"location": {
"canada": "https:\/\/google.ca",
"united states": "https:\/\/google.us"
},
"device": {
"iphone": "https:\/\/google.com",
"android": "https:\/\/google.com"
},
"expiry": null,
"date": "2020-11-10 18:01:43"
},
"data": {
"clicks": 0,
"uniqueClicks": 0,
"topCountries": 0,
"topReferrers": 0,
"topBrowsers": 0,
"topOs": 0,
"socialCount": {
"facebook": 0,
"twitter": 0,
"google": 0
}
}
}
Shorten a Link
https://shorturl.is/api/url/add
To shorten a link, send a POST request with the data as JSON in the raw body, as shown in the example. The example includes every parameter you can send. You do not have to send them all: the table shows which are required.
| Parameter | Description |
|---|---|
| url | (required) Long URL to shorten. |
| custom | (optional) Custom alias, used instead of a random one. |
| type | (optional) Redirection type: direct, frame or splash. For a custom splash page, send its id instead. For a CTA page, send overlay-id. |
| password | (optional) Password to protect the link |
| domain | (optional) Custom domain |
| expiry | (optional) Date and time the link expires, for example 2021-09-28 23:11:16 |
| geotarget | (optional) Geotargeting data: a list of locations, each with its own destination link |
| devicetarget | (optional) Device targeting data: a list of devices, each with its own destination link |
| languagetarget | (optional) Language targeting data: a list of languages, each with its own destination link |
| metatitle | (optional) Meta title |
| metadescription | (optional) Meta description |
| metaimage | (optional) URL of a JPG or PNG image |
| description | (optional) Note or description |
| pixels | (optional) List of pixel IDs |
| channel | (optional) Channel ID |
| campaign | (optional) Campaign ID |
| deeplink | (optional) Object with your app store links. If you use this, set device targeting as well. You can also set "auto" to true inside this object to generate the deep links from the long URL automatically. |
curl --location --request POST 'https://shorturl.is/api/url/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"url": "https://google.com",
"custom": "google",
"password": "mypass",
"expiry": "2020-11-11 12:00:00",
"type": "splash",
"metatitle": "Not Google",
"metadescription": "Not Google description",
"metaimage": "https://www.mozilla.org/media/protocol/img/logos/firefox/browser/og.4ad05d4125a5.png",
"description": "For facebook",
"pixels": [
1,
2,
3,
4
],
"channel": 1,
"campaign": 1,
"deeplink": {
"auto": true,
"apple": "https://apps.apple.com/us/app/google/id284815942",
"google": "https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en_CA&gl=US"
},
"geotarget": [
{
"location": "Canada",
"link": "https://google.ca"
},
{
"location": "United States",
"link": "https://google.us"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https://google.com"
},
{
"device": "Android",
"link": "https://google.com"
}
],
"languagetarget": [
{
"language": "en",
"link": "https://google.com"
},
{
"language": "fr",
"link": "https://google.ca"
}
],
"parameters": [
{
"name": "aff",
"value": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/url/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{
"url": "https://google.com",
"custom": "google",
"password": "mypass",
"expiry": "2020-11-11 12:00:00",
"type": "splash",
"metatitle": "Not Google",
"metadescription": "Not Google description",
"metaimage": "https://www.mozilla.org/media/protocol/img/logos/firefox/browser/og.4ad05d4125a5.png",
"description": "For facebook",
"pixels": [
1,
2,
3,
4
],
"channel": 1,
"campaign": 1,
"deeplink": {
"auto": true,
"apple": "https://apps.apple.com/us/app/google/id284815942",
"google": "https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en_CA&gl=US"
},
"geotarget": [
{
"location": "Canada",
"link": "https://google.ca"
},
{
"location": "United States",
"link": "https://google.us"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https://google.com"
},
{
"device": "Android",
"link": "https://google.com"
}
],
"languagetarget": [
{
"language": "en",
"link": "https://google.com"
},
{
"language": "fr",
"link": "https://google.ca"
}
],
"parameters": [
{
"name": "aff",
"value": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/url/add', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"url": "https://google.com",
"custom": "google",
"password": "mypass",
"expiry": "2020-11-11 12:00:00",
"type": "splash",
"metatitle": "Not Google",
"metadescription": "Not Google description",
"metaimage": "https://www.mozilla.org/media/protocol/img/logos/firefox/browser/og.4ad05d4125a5.png",
"description": "For facebook",
"pixels": [
1,
2,
3,
4
],
"channel": 1,
"campaign": 1,
"deeplink": {
"auto": true,
"apple": "https://apps.apple.com/us/app/google/id284815942",
"google": "https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en_CA&gl=US"
},
"geotarget": [
{
"location": "Canada",
"link": "https://google.ca"
},
{
"location": "United States",
"link": "https://google.us"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https://google.com"
},
{
"device": "Android",
"link": "https://google.com"
}
],
"languagetarget": [
{
"language": "en",
"link": "https://google.com"
},
{
"language": "fr",
"link": "https://google.ca"
}
],
"parameters": [
{
"name": "aff",
"value": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
})
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/url/add"
payload = """{
"url": "https://google.com",
"custom": "google",
"password": "mypass",
"expiry": "2020-11-11 12:00:00",
"type": "splash",
"metatitle": "Not Google",
"metadescription": "Not Google description",
"metaimage": "https://www.mozilla.org/media/protocol/img/logos/firefox/browser/og.4ad05d4125a5.png",
"description": "For facebook",
"pixels": [
1,
2,
3,
4
],
"channel": 1,
"campaign": 1,
"deeplink": {
"auto": true,
"apple": "https://apps.apple.com/us/app/google/id284815942",
"google": "https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en_CA&gl=US"
},
"geotarget": [
{
"location": "Canada",
"link": "https://google.ca"
},
{
"location": "United States",
"link": "https://google.us"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https://google.com"
},
{
"device": "Android",
"link": "https://google.com"
}
],
"languagetarget": [
{
"language": "en",
"link": "https://google.com"
},
{
"language": "fr",
"link": "https://google.ca"
}
],
"parameters": [
{
"name": "aff",
"value": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}"""
headers = {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://shorturl.is/api/url/add");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
request.Content = new StringContent("""
{
"url": "https://google.com",
"custom": "google",
"password": "mypass",
"expiry": "2020-11-11 12:00:00",
"type": "splash",
"metatitle": "Not Google",
"metadescription": "Not Google description",
"metaimage": "https://www.mozilla.org/media/protocol/img/logos/firefox/browser/og.4ad05d4125a5.png",
"description": "For facebook",
"pixels": [
1,
2,
3,
4
],
"channel": 1,
"campaign": 1,
"deeplink": {
"auto": true,
"apple": "https://apps.apple.com/us/app/google/id284815942",
"google": "https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en_CA&gl=US"
},
"geotarget": [
{
"location": "Canada",
"link": "https://google.ca"
},
{
"location": "United States",
"link": "https://google.us"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https://google.com"
},
{
"device": "Android",
"link": "https://google.com"
}
],
"languagetarget": [
{
"language": "en",
"link": "https://google.com"
},
{
"language": "fr",
"link": "https://google.ca"
}
],
"parameters": [
{
"name": "aff",
"value": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"id": 3,
"shorturl": "https:\/\/shorturl.is\/google"
}
Update Link
https://shorturl.is/api/url/:id/update
To update a link, send a PUT request with the data as JSON in the raw body, as shown in the example. The example includes every parameter you can send. You do not have to send them all: the table shows which are required.
| Parameter | Description |
|---|---|
| url | (required) Long URL to shorten. |
| custom | (optional) Custom alias, used instead of a random one. |
| type | (optional) Redirection type: direct, frame or splash |
| password | (optional) Password to protect the link |
| domain | (optional) Custom domain |
| expiry | (optional) Date and time the link expires, for example 2021-09-28 23:11:16 |
| geotarget | (optional) Geotargeting data: a list of locations, each with its own destination link |
| devicetarget | (optional) Device targeting data: a list of devices, each with its own destination link |
| languagetarget | (optional) Language targeting data: a list of languages, each with its own destination link |
| metatitle | (optional) Meta title |
| metadescription | (optional) Meta description |
| metaimage | (optional) URL of a JPG or PNG image |
| pixels | (optional) List of pixel IDs |
| channel | (optional) Channel ID |
| campaign | (optional) Campaign ID |
| deeplink | (optional) Object with your app store links. If you use this, set device targeting as well. |
curl --location --request PUT 'https://shorturl.is/api/url/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"url": "https://google.com",
"custom": "google",
"password": "mypass",
"expiry": "2020-11-11 12:00:00",
"type": "splash",
"pixels": [
1,
2,
3,
4
],
"channel": 1,
"deeplink": {
"apple": "https://apps.apple.com/us/app/google/id284815942",
"google": "https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en_CA&gl=US"
},
"geotarget": [
{
"location": "Canada",
"link": "https://google.ca"
},
{
"location": "United States",
"link": "https://google.us"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https://google.com"
},
{
"device": "Android",
"link": "https://google.com"
}
],
"parameters": [
{
"name": "aff",
"value": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/url/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{
"url": "https://google.com",
"custom": "google",
"password": "mypass",
"expiry": "2020-11-11 12:00:00",
"type": "splash",
"pixels": [
1,
2,
3,
4
],
"channel": 1,
"deeplink": {
"apple": "https://apps.apple.com/us/app/google/id284815942",
"google": "https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en_CA&gl=US"
},
"geotarget": [
{
"location": "Canada",
"link": "https://google.ca"
},
{
"location": "United States",
"link": "https://google.us"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https://google.com"
},
{
"device": "Android",
"link": "https://google.com"
}
],
"parameters": [
{
"name": "aff",
"value": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/url/:id/update', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"url": "https://google.com",
"custom": "google",
"password": "mypass",
"expiry": "2020-11-11 12:00:00",
"type": "splash",
"pixels": [
1,
2,
3,
4
],
"channel": 1,
"deeplink": {
"apple": "https://apps.apple.com/us/app/google/id284815942",
"google": "https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en_CA&gl=US"
},
"geotarget": [
{
"location": "Canada",
"link": "https://google.ca"
},
{
"location": "United States",
"link": "https://google.us"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https://google.com"
},
{
"device": "Android",
"link": "https://google.com"
}
],
"parameters": [
{
"name": "aff",
"value": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
})
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/url/:id/update"
payload = """{
"url": "https://google.com",
"custom": "google",
"password": "mypass",
"expiry": "2020-11-11 12:00:00",
"type": "splash",
"pixels": [
1,
2,
3,
4
],
"channel": 1,
"deeplink": {
"apple": "https://apps.apple.com/us/app/google/id284815942",
"google": "https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en_CA&gl=US"
},
"geotarget": [
{
"location": "Canada",
"link": "https://google.ca"
},
{
"location": "United States",
"link": "https://google.us"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https://google.com"
},
{
"device": "Android",
"link": "https://google.com"
}
],
"parameters": [
{
"name": "aff",
"value": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}"""
headers = {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://shorturl.is/api/url/:id/update");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
request.Content = new StringContent("""
{
"url": "https://google.com",
"custom": "google",
"password": "mypass",
"expiry": "2020-11-11 12:00:00",
"type": "splash",
"pixels": [
1,
2,
3,
4
],
"channel": 1,
"deeplink": {
"apple": "https://apps.apple.com/us/app/google/id284815942",
"google": "https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox&hl=en_CA&gl=US"
},
"geotarget": [
{
"location": "Canada",
"link": "https://google.ca"
},
{
"location": "United States",
"link": "https://google.us"
}
],
"devicetarget": [
{
"device": "iPhone",
"link": "https://google.com"
},
{
"device": "Android",
"link": "https://google.com"
}
],
"parameters": [
{
"name": "aff",
"value": "3"
},
{
"device": "gtm_source",
"link": "api"
}
]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"id": 3,
"short": "https:\/\/shorturl.is\/google"
}
Delete a Link
https://shorturl.is/api/url/:id/delete
To delete a link, you need to send a DELETE request.
curl --location --request DELETE 'https://shorturl.is/api/url/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/url/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/url/:id/delete', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/url/:id/delete"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("DELETE", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Delete, "https://shorturl.is/api/url/:id/delete");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"message": "Link has been deleted successfully"
}
List Pixels
https://shorturl.is/api/pixels?limit=2&page=1
Get your pixels. Use the parameters below to choose the page and the number of results per page.
| Parameter | Description |
|---|---|
| limit | (optional) Number of results per page |
| page | (optional) Page number to return |
curl --location --request GET 'https://shorturl.is/api/pixels?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/pixels?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/pixels?limit=2&page=1', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/pixels?limit=2&page=1"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://shorturl.is/api/pixels?limit=2&page=1");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"pixels": [
{
"id": 1,
"type": "gtmpixel",
"name": "GTM Pixel",
"tag": "GA-123456789",
"date": "2020-11-10 18:00:00"
},
{
"id": 2,
"type": "twitterpixel",
"name": "Twitter Pixel",
"tag": "1234567",
"date": "2020-11-10 18:10:00"
}
]
}
}
Create a Pixel
https://shorturl.is/api/pixel/add
Create a pixel. You need to send the pixel type, a name and the tag.
| Parameter | Description |
|---|---|
| type | (required) gtmpixel | gapixel | fbpixel | adwordspixel | linkedinpixel | twitterpixel | adrollpixel | quorapixel | pinterest | bing | snapchat | reddit | tiktok |
| name | (required) Custom name for your pixel |
| tag | (required) The tag for the pixel |
curl --location --request POST 'https://shorturl.is/api/pixel/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "gtmpixel",
"name": "My GTM",
"tag": "GTM-ABCDE"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/pixel/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{
"type": "gtmpixel",
"name": "My GTM",
"tag": "GTM-ABCDE"
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/pixel/add', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"type": "gtmpixel",
"name": "My GTM",
"tag": "GTM-ABCDE"
})
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/pixel/add"
payload = """{
"type": "gtmpixel",
"name": "My GTM",
"tag": "GTM-ABCDE"
}"""
headers = {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://shorturl.is/api/pixel/add");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
request.Content = new StringContent("""
{
"type": "gtmpixel",
"name": "My GTM",
"tag": "GTM-ABCDE"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"id": 1
}
Update Pixel
https://shorturl.is/api/pixel/:id/update
To update a pixel, send a PUT request with the data as JSON in the raw body, as shown in the example. The example includes every parameter you can send. You do not have to send them all: the table shows which are required.
| Parameter | Description |
|---|---|
| name | (optional) Custom name for your pixel |
| tag | (required) The tag for the pixel |
curl --location --request PUT 'https://shorturl.is/api/pixel/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "My GTM",
"tag": "GTM-ABCDE"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/pixel/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{
"name": "My GTM",
"tag": "GTM-ABCDE"
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/pixel/:id/update', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "My GTM",
"tag": "GTM-ABCDE"
})
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/pixel/:id/update"
payload = """{
"name": "My GTM",
"tag": "GTM-ABCDE"
}"""
headers = {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://shorturl.is/api/pixel/:id/update");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
request.Content = new StringContent("""
{
"name": "My GTM",
"tag": "GTM-ABCDE"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"message": "Pixel has been updated successfully."
}
Delete Pixel
https://shorturl.is/api/pixel/:id/delete
To delete a pixel, you need to send a DELETE request.
curl --location --request DELETE 'https://shorturl.is/api/pixel/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/pixel/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/pixel/:id/delete', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/pixel/:id/delete"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("DELETE", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Delete, "https://shorturl.is/api/pixel/:id/delete");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"message": "Pixel has been deleted successfully."
}
List QR codes
https://shorturl.is/api/qr?limit=2&page=1
Get your QR codes. Use the parameters below to choose the page and the number of results per page.
| Parameter | Description |
|---|---|
| limit | (optional) Number of results per page |
| page | (optional) Page number to return |
curl --location --request GET 'https://shorturl.is/api/qr?limit=2&page=1' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/qr?limit=2&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/qr?limit=2&page=1', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/qr?limit=2&page=1"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://shorturl.is/api/qr?limit=2&page=1");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": "0",
"data": {
"result": 2,
"perpage": 2,
"currentpage": 1,
"nextpage": 1,
"maxpage": 1,
"qrs": [
{
"id": 2,
"link": "https:\/\/shorturl.is\/qr\/a2d5e",
"scans": 0,
"name": "Google",
"date": "2020-11-10 18:01:43"
},
{
"id": 1,
"link": "https:\/\/shorturl.is\/qr\/b9edfe",
"scans": 5,
"name": "Google Canada",
"date": "2020-11-10 18:00:25"
}
]
}
}
Get a single QR Code
https://shorturl.is/api/qr/:id
Get the details of a single QR code.
curl --location --request GET 'https://shorturl.is/api/qr/:id' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/qr/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/qr/:id', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/qr/:id"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://shorturl.is/api/qr/:id");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"details": {
"id": 1,
"link": "https:\/\/shorturl.is\/qr\/b9edfe",
"scans": 5,
"name": "Google Canada",
"date": "2020-11-10 18:00:25"
},
"data": {
"clicks": 1,
"uniqueClicks": 1,
"topCountries": {
"Unknown": "1"
},
"topReferrers": {
"Direct, email and other": "1"
},
"topBrowsers": {
"Chrome": "1"
},
"topOs": {
"Windows 10": "1"
},
"socialCount": {
"facebook": 0,
"twitter": 0,
"instagram": 0
}
}
}
Create a QR Code
https://shorturl.is/api/qr/add
To create a QR code, send a POST request with the data as JSON in the raw body, as shown in the example. The example includes every parameter you can send. You do not have to send them all: the table shows which are required.
| Parameter | Description |
|---|---|
| type | (required) One of: text, vcard, link, email, phone, sms or wifi |
| data | (required) The data to put in the QR code. This is a string or an array, depending on the type. |
| background | (optional) Background colour as RGB, for example rgb(255,255,255) |
| foreground | (optional) Foreground colour as RGB, for example rgb(0,0,0) |
| logo | (optional) Path to the logo, either PNG or JPG |
| name | (optional) QR Code name |
curl --location --request POST 'https://shorturl.is/api/qr/add' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "link",
"data": "https://google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https://site.com/logo.png",
"name": "QR Code API"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/qr/add",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{
"type": "link",
"data": "https://google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https://site.com/logo.png",
"name": "QR Code API"
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/qr/add', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"type": "link",
"data": "https://google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https://site.com/logo.png",
"name": "QR Code API"
})
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/qr/add"
payload = """{
"type": "link",
"data": "https://google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https://site.com/logo.png",
"name": "QR Code API"
}"""
headers = {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://shorturl.is/api/qr/add");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
request.Content = new StringContent("""
{
"type": "link",
"data": "https://google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https://site.com/logo.png",
"name": "QR Code API"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"id": 3,
"link": "https:\/\/shorturl.is\/qr\/a58f79"
}
Update QR Code
https://shorturl.is/api/qr/:id/update
To update a QR code, send a PUT request with the data as JSON in the raw body, as shown in the example. The example includes every parameter you can send. You do not have to send them all: the table shows which are required.
| Parameter | Description |
|---|---|
| data | (required) The data to put in the QR code. This is a string or an array, depending on the type. |
| background | (optional) Background colour as RGB, for example rgb(255,255,255) |
| foreground | (optional) Foreground colour as RGB, for example rgb(0,0,0) |
| logo | (optional) Path to the logo, either PNG or JPG |
curl --location --request PUT 'https://shorturl.is/api/qr/:id/update' \
--header 'Authorization: Bearer YOURAPIKEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "link",
"data": "https://google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https://site.com/logo.png"
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/qr/:id/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{
"type": "link",
"data": "https://google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https://site.com/logo.png"
}',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/qr/:id/update', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"type": "link",
"data": "https://google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https://site.com/logo.png"
})
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/qr/:id/update"
payload = """{
"type": "link",
"data": "https://google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https://site.com/logo.png"
}"""
headers = {
'Authorization': 'Bearer YOURAPIKEY',
'Content-Type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://shorturl.is/api/qr/:id/update");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
request.Content = new StringContent("""
{
"type": "link",
"data": "https://google.com",
"background": "rgb(255,255,255)",
"foreground": "rgb(0,0,0)",
"logo": "https://site.com/logo.png"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"message": "QR has been updated successfully."
}
Delete a QR Code
https://shorturl.is/api/qr/:id/delete
To delete a QR code, you need to send a DELETE request.
curl --location --request DELETE 'https://shorturl.is/api/qr/:id/delete' \
--header 'Authorization: Bearer YOURAPIKEY'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://shorturl.is/api/qr/:id/delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_MAXREDIRS => 2,
CURLOPT_TIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOURAPIKEY",
],
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
fetch('https://shorturl.is/api/qr/:id/delete', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOURAPIKEY'
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error(error));
import requests
url = "https://shorturl.is/api/qr/:id/delete"
headers = {
'Authorization': 'Bearer YOURAPIKEY'
}
response = requests.request("DELETE", url, headers=headers)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Delete, "https://shorturl.is/api/qr/:id/delete");
request.Headers.Add("Authorization", "Bearer YOURAPIKEY");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Server response
{
"error": 0,
"message": "QR Code has been deleted successfully."
}