1) API key ilə autentifikasiya
Sorğularda API key göndərmək üçün x-api-key və ya Authorization: Bearer ... istifadə edin.
- Endpoint:
GET /api/pro/v1/account - Pro plan aktiv deyilsə cavab:
403 Pro plan required
Pro API key ilə avtomatik link yaratmaq və hesab məlumatlarını oxumaq üçün sürətli bələdçi.
Sorğularda API key göndərmək üçün x-api-key və ya Authorization: Bearer ... istifadə edin.
GET /api/pro/v1/account403 Pro plan requiredYeni endpoint: POST /api/pro/v1/shorten. JSON body-də ən azı original_url göndərin.
custom_alias (opsional)custom_domain (opsional, hesabınıza bağlı və aktiv olmalıdır)max_clicks, expires_at (opsional)curl -X POST "https://ovlink.sbs/api/pro/v1/shorten" \
-H "Content-Type: application/json" \
-H "x-api-key: ovk_your_api_key_here" \
-d '{
"original_url": "https://example.com/product/123",
"custom_alias": "my-product",
"max_clicks": 500
}'
$headers = @{ "x-api-key" = "ovk_your_api_key_here" }
$body = @{
original_url = "https://example.com/product/123"
custom_alias = "my-product"
max_clicks = 500
} | ConvertTo-Json -Compress
Invoke-RestMethod -Method Post `
-Uri "https://ovlink.sbs/api/pro/v1/shorten" `
-Headers $headers `
-ContentType "application/json" `
-Body $body
const res = await fetch("https://ovlink.sbs/api/pro/v1/shorten", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": process.env.OVLINK_API_KEY
},
body: JSON.stringify({
original_url: "https://example.com/campaign/spring",
custom_alias: "spring-campaign"
})
});
const data = await res.json();
console.log(data);
import requests
url = "https://ovlink.sbs/api/pro/v1/shorten"
headers = {
"x-api-key": "ovk_your_api_key_here",
"Content-Type": "application/json"
}
payload = {
"original_url": "https://example.com/blog/new-post",
"custom_alias": "new-post"
}
r = requests.post(url, headers=headers, json=payload, timeout=15)
print(r.status_code, r.json())
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "ovk_your_api_key_here");
var json = """
{
"original_url": "https://example.com/docs",
"custom_alias": "docs-link"
}
""";
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://ovlink.sbs/api/pro/v1/shorten", content);
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
#include <curl/curl.h>
#include <string>
int main() {
CURL* curl = curl_easy_init();
if (!curl) return 1;
std::string payload = R"({
"original_url":"https://example.com/page",
"custom_alias":"cpp-demo"
})";
struct curl_slist* headers = nullptr;
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "x-api-key: ovk_your_api_key_here");
curl_easy_setopt(curl, CURLOPT_URL, "https://ovlink.sbs/api/pro/v1/shorten");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload.c_str());
curl_easy_setopt(curl, CURLOPT_POST, 1L);
CURLcode rc = curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
return rc == CURLE_OK ? 0 : 1;
}