ต่อยอดจากลิงก์ของคุณ
สร้างลิงก์แบรนด์ สร้าง QR โค้ด และดึงข้อมูลการวิเคราะห์จากแอปของคุณเอง REST เอนด์พอยต์ที่คาดเดาได้ JSON ทุกที่ และ webhook สำหรับอีเวนต์แบบเรียลไทม์
curl -X POST https://shortgo.io/api/v1/links \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://example.com/launch","alias":"launch"}'
const res = await fetch("https://shortgo.io/api/v1/links", { method: "POST", headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ url: "https://example.com/launch" }), }); const { short_url } = await res.json();
import requests r = requests.post("https://shortgo.io/api/v1/links", headers={"Authorization": f"Bearer {API_KEY}"}, json={"url": "https://example.com/launch"}) print(r.json()["short_url"])
$ch = curl_init("https://shortgo.io/api/v1/links"); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ["Authorization: Bearer $apiKey", "Content-Type: application/json"], CURLOPT_POSTFIELDS => json_encode(["url" => "https://example.com/launch"]), ]); $link = json_decode(curl_exec($ch), true);
การยืนยันตัวตน
Create an API key in your dashboard and send it as a Bearer token in the Authorization header. Keys can be read-only or read/write and revoked at any time.
ขีดจำกัดอัตรา
Limits depend on your plan (requests per minute). Every response includes X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers; exceeding the limit returns 429.
Webhooks
Subscribe to link.created, link.clicked, link.deleted and overlay.response events. Payloads are signed with HMAC-SHA256 so you can verify they came from us.
เอนด์พอยต์
Base URL
คำขอและการตอบกลับทั้งหมดใช้ JSON ข้อผิดพลาดจะส่งข้อความ "error" พร้อมรหัสสถานะ HTTP ที่สื่อความหมาย เอนด์พอยต์แบบรายการแบ่งหน้าด้วย page และ per_page
เอกสารอ้างอิงฉบับเต็มพร้อมสคีมาคำขอและการตอบกลับมีอยู่ในแดชบอร์ดของคุณ
| วิธีการ | เอนด์พอยต์ | คำอธิบาย |
|---|---|---|
| GET | /links | List links with search and filters |
| POST | /links | สร้างลิงก์สั้น |
| GET | /links/{id} | ดึงข้อมูลลิงก์ |
| PATCH | /links/{id} | Update destination, alias or options |
| DELETE | /links/{id} | ลบลิงก์ |
| GET | /links/{id}/stats | Clicks, countries, devices and referrers |
| GET | /qr | แสดงรายการ QR โค้ด |
| POST | /qr | Create a dynamic QR code |
| GET | /domains | List your branded domains |
| GET | /campaigns | แสดงรายการแคมเปญ |
| GET | /account | Current user and plan usage |
ตรวจสอบลายเซ็น webhook
ทุกการส่งมี header X-ShortGo-Timestamp และ X-ShortGo-Signature ลายเซ็นคือ sha256= ตามด้วย HMAC-SHA256 แบบเลขฐานสิบหกของ "timestamp.body" ที่ใช้ secret ของ webhook ของคุณ เปรียบเทียบแบบ constant time และปฏิเสธ timestamp ที่เก่า
{
"event": "link.clicked",
"created_at": "2026-01-01T12:00:00Z",
"data": {
"link_id": 42,
"country": "DE",
"device": "mobile",
"referrer": "instagram.com"
}
}