curl -X POST https://klic.in/api/v1/links \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"destination": "https://mybrand.com/launch-promo",
"customSlug": "launch2026"
}'
// npm install node-fetch (or native fetch in Node 18+)
const response = await fetch('https://klic.in/api/v1/links', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
destination: 'https://mybrand.com/launch-promo',
customSlug: 'launch2026'
})
});
const data = await response.json();
console.log('Short Link:', data.data.shortUrl);
# pip install requests
import requests
url = "https://klic.in/api/v1/links"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"destination": "https://mybrand.com/launch-promo",
"customSlug": "launch2026"
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(f"Short Link: {data['data']['shortUrl']}")
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
var payload = new {
destination = "https://mybrand.com/launch-promo",
customSlug = "launch2026"
};
var content = new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://klic.in/api/v1/links", content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
<?php
$curl = curl_init();
$payload = [
'destination' => 'https://mybrand.com/launch-promo',
'customSlug' => 'launch2026'
];
curl_setopt_array($curl, [
CURLOPT_URL => 'https://klic.in/api/v1/links',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json'
],
]);
$response = curl_exec($curl);
curl_close($curl);
$data = json_decode($response, true);
echo 'Short Link: ' . $data['data']['shortUrl'];
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload := map[string]string{
"destination": "https://mybrand.com/launch-promo",
"customSlug": "launch2026",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", "https://klic.in/api/v1/links", bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}