API Documentation

The API is currently disabled by the administrator.
Overview

Our REST API allows you to programmatically create short URLs from your applications. The API is simple to use and returns JSON responses.

Base URL: https://reviwe-tryt-lnk.site/api

Endpoints

POST /shorten

Create a new short URL.

Headers
Header Value Required
Content-Type application/json Yes
X-API-Key Your API key Yes
Request Body
{
  "url": "https://example.com/very/long/url",
  "custom_alias": "my-link",      // Optional
  "expires_at": "2024-12-31",     // Optional (YYYY-MM-DD format)
  "redirect_type": "302"         // Optional (301 or 302)
}
Response
{
  "success": true,
  "short_code": "abc123",
  "short_url": "https://reviwe-tryt-lnk.site/abc123",
  "long_url": "https://example.com/very/long/url"
}
GET /info/{short_code}

Get information about a short URL.

Headers
Header Value Required
X-API-Key Your API key Yes
Response
{
  "short_code": "abc123",
  "long_url": "https://example.com/very/long/url",
  "clicks": 42,
  "created_at": "2024-01-15 10:30:00"
}

Error Responses

Status Code Description
400 Bad Request - Invalid input data
401 Unauthorized - Invalid or missing API key
403 Forbidden - API access disabled
404 Not Found - Short code doesn't exist
429 Too Many Requests - Rate limit exceeded
500 Server Error - Something went wrong

Example Usage

cURL
curl -X POST https://reviwe-tryt-lnk.site/api/shorten \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{"url": "https://example.com/very/long/url"}'
JavaScript (Fetch)
fetch('https://reviwe-tryt-lnk.site/api/shorten', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'your_api_key_here'
  },
  body: JSON.stringify({
    url: 'https://example.com/very/long/url'
  })
})
.then(response => response.json())
.then(data => console.log(data));
PHP
$ch = curl_init('https://reviwe-tryt-lnk.site/api/shorten');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
  'url' => 'https://example.com/very/long/url'
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Content-Type: application/json',
  'X-API-Key: your_api_key_here'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
Note: API keys can be generated from your dashboard once you have an account. Contact the administrator for API access.