List Available Domains
curl --request GET \
--url https://api.u301.com/v2/shorten-domains \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.u301.com/v2/shorten-domains"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.u301.com/v2/shorten-domains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.u301.com/v2/shorten-domains",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.u301.com/v2/shorten-domains"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.u301.com/v2/shorten-domains")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.u301.com/v2/shorten-domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"meta": {
"total": 6,
"perPage": 10,
"currentPage": 1,
"lastPage": 1,
"firstPage": 1
},
"data": [
{
"domainName": "x.jarfire.org",
"visibility": "private"
},
{
"domainName": "go.jarfire.org",
"visibility": "private"
},
{
"domainName": "t.fbi.com",
"visibility": "public"
},
{
"domainName": "az.jarfire.org",
"visibility": "public"
},
{
"domainName": "localhost",
"visibility": "public"
},
{
"domainName": "a1.jarfire.org",
"visibility": "private"
}
]
}Shorten Domain
List Shorten Domains
List all available domains for URL shortening.
GET
/
shorten-domains
List Available Domains
curl --request GET \
--url https://api.u301.com/v2/shorten-domains \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.u301.com/v2/shorten-domains"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.u301.com/v2/shorten-domains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.u301.com/v2/shorten-domains",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.u301.com/v2/shorten-domains"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.u301.com/v2/shorten-domains")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.u301.com/v2/shorten-domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"meta": {
"total": 6,
"perPage": 10,
"currentPage": 1,
"lastPage": 1,
"firstPage": 1
},
"data": [
{
"domainName": "x.jarfire.org",
"visibility": "private"
},
{
"domainName": "go.jarfire.org",
"visibility": "private"
},
{
"domainName": "t.fbi.com",
"visibility": "public"
},
{
"domainName": "az.jarfire.org",
"visibility": "public"
},
{
"domainName": "localhost",
"visibility": "public"
},
{
"domainName": "a1.jarfire.org",
"visibility": "private"
}
]
}Params: Visibiliy
available options arepublicdomains provided by the system and available for all users to use.privateyour custom domains that you have created and can only be used by you.allall domains that you can use.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Results per Page, range: 1-500
Current Page
Domain Types
Available options:
public, private, all