Dokumentasi resmi untuk integrasi shortlink.
Gunakan API Key berikut untuk pengujian:
| Param | Wajib | Keterangan |
|---|---|---|
url |
YES | Link tujuan asli |
apikey |
YES | Gunakan saxia |
code |
NO | Custom alias (unik) |
exp |
NO | Isi 7, 15, atau kosong |
{
"status": true,
"short": "https://snx.biz.id/group",
"code": "group",
"expiredAt": null
}
{
"error": "Invalid API key"
}
curl "https://snx.biz.id/api/create?url=https://google.com&apikey=saxia"
const axios = require("axios");
async function createLink() {
try {
const response = await axios.get("https://snx.biz.id/api/create", {
params: {
url: "https://google.com",
apikey: "saxia",
code: "custom123"
}
});
console.log(response.data.short);
} catch (error) {
console.error(error);
}
}
createLink();
import requests
params = {
"url": "https://google.com",
"apikey": "saxia",
"code": "pythonlink"
}
res = requests.get("https://snx.biz.id/api/create", params=params)
print(res.json().get("short"))
<?php $url = "https://snx.biz.id/api/create?url=https://google.com&apikey=saxia"; $response = file_get_contents($url); $data = json_decode($response, true); echo $data['short']; ?>
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://snx.biz.id/api/create?url=https://google.com&apikey=saxia")
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}