Get Link
Added in v1.0
GET
https://api.example.com/api/link/{name}Requires authentication: x-api-key: YOUR_API_KEY
Retrieves an existing shortened link by its name or destination URL. The supplied value is matched against both the name and url fields.
Headers
x-api-keystringrequiredYour API authentication key.
Path parameters
namestringrequiredThe name of the shortened link or its complete destination URL. A URL must be URL-encoded (e.g.https%3A%2F%2Fgoogle.com).
Responses
- 200OK
- 404Not Found
Request
curl -X GET 'https://api.example.com/api/link/google' \
-H 'x-api-key: YOUR_API_KEY'
const res = await fetch('https://api.example.com/api/link/google', {
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const link = await res.json();
import requests
res = requests.get('https://api.example.com/api/link/google', headers={'x-api-key': 'YOUR_API_KEY'})
link = res.json()
$ch = curl_init('https://api.example.com/api/link/google');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$link = json_decode(curl_exec($ch), true);
200 OK
{
"id": 1,
"name": "google",
"url": "https://google.com",
"count": 0,
"creator": "API",
"creatorID": "0",
"createdAt": 1795400000000
}
404 Not Found
{
"msg": "Link not found from name or url."
}
Discussion 0
Reading is open to everyone. Posting, replying, reacting and reporting require a Discord account — we only receive your public username and avatar.
No comments yet. Sign in with Discord to start the conversation.
Sign in required
Reading is open to everyone. Posting, replying, reacting and reporting require a Discord account — we only receive your public username and avatar.