Introduction
This documentation aims to provide all the information you need to work with our API.
Base URL
https://sholi.co
Authenticating requests
Authenticate requests to this API's endpoints by sending an Authorization
header with the value "Bearer {YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your token by visiting your dashboard and clicking Generate API token.
Link Management
APIs for shortening URLs
Get Links with Pagination
requires authentication
Example request:
curl --request GET \
--get "https://sholi.co/api/v1/links?page=1&per_page=20" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://sholi.co/api/v1/links"
);
const params = {
"page": "1",
"per_page": "20",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://sholi.co/api/v1/links',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page'=> '1',
'per_page'=> '20',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://sholi.co/api/v1/links'
params = {
'page': '1',
'per_page': '20',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 58
access-control-allow-origin: *
{
"data": [],
"links": {
"first": "https://sholi.co/api/v1/links?page=1",
"last": "https://sholi.co/api/v1/links?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": null,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://sholi.co/api/v1/links?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://sholi.co/api/v1/links",
"per_page": 20,
"to": null,
"total": 0
}
}
Received response:
Request failed with error:
Create a New Link.
requires authentication
Example request:
curl --request POST \
"https://sholi.co/api/v1/links" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"large_url\": \"http:\\/\\/www.klocko.com\\/ut-quidem-quod-explicabo-et.html\"
}"
const url = new URL(
"https://sholi.co/api/v1/links"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"large_url": "http:\/\/www.klocko.com\/ut-quidem-quod-explicabo-et.html"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://sholi.co/api/v1/links',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'large_url' => 'http://www.klocko.com/ut-quidem-quod-explicabo-et.html',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://sholi.co/api/v1/links'
payload = {
"large_url": "http:\/\/www.klocko.com\/ut-quidem-quod-explicabo-et.html"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Received response:
Request failed with error:
Get a Links by id.
requires authentication
Example request:
curl --request GET \
--get "https://sholi.co/api/v1/links/20" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://sholi.co/api/v1/links/20"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://sholi.co/api/v1/links/20',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://sholi.co/api/v1/links/20'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 57
access-control-allow-origin: *
{
"message": "Link Not Found"
}
Received response:
Request failed with error:
Update a Link.
requires authentication
Example request:
curl --request PUT \
"https://sholi.co/api/v1/links/15" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"large_url\": \"http:\\/\\/cartwright.com\\/rerum-autem-repudiandae-expedita-ad-labore\"
}"
const url = new URL(
"https://sholi.co/api/v1/links/15"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"large_url": "http:\/\/cartwright.com\/rerum-autem-repudiandae-expedita-ad-labore"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://sholi.co/api/v1/links/15',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'large_url' => 'http://cartwright.com/rerum-autem-repudiandae-expedita-ad-labore',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://sholi.co/api/v1/links/15'
payload = {
"large_url": "http:\/\/cartwright.com\/rerum-autem-repudiandae-expedita-ad-labore"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
Received response:
Request failed with error:
Delete a Link.
requires authentication
Example request:
curl --request DELETE \
"https://sholi.co/api/v1/links/20" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://sholi.co/api/v1/links/20"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://sholi.co/api/v1/links/20',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://sholi.co/api/v1/links/20'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
Received response:
Request failed with error:
User
GET api/v1/user
requires authentication
Example request:
curl --request GET \
--get "https://sholi.co/api/v1/user" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://sholi.co/api/v1/user"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://sholi.co/api/v1/user',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://sholi.co/api/v1/user'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"id": 4,
"first_name": "Talha",
"last_name": "Hakeem",
"role": 1,
"email": "talha@getnada.com",
"email_verified_at": null,
"company_id": 28,
"created_at": "2022-11-24T15:18:06.000000Z",
"updated_at": "2022-11-24T15:18:06.000000Z",
"last_ip": null,
"plan": {
"id": 1,
"short_links": 100,
"custom_links_enabled": 1,
"custom_links": 5
}
}
Received response:
Request failed with error: