ShortGo
Tính năngBảng giá BlogTrợ giúpĐăng nhập
REST · JSON · Webhooks

Xây dựng trên nền tảng liên kết của bạn

Tạo liên kết thương hiệu, sinh mã QR và lấy số liệu phân tích từ ứng dụng của bạn. REST endpoint dễ đoán, JSON ở mọi nơi và webhook cho sự kiện thời gian thực.

POST /links
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);
201 Created → {"id": 42, "short_url": "https://go.example/launch", …}

Xác thực

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.

Giới hạn tốc độ

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.

Webhook

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.

Endpoint

URL gốc

https://shortgo.io/api/v1

Mọi yêu cầu và phản hồi đều dùng JSON. Lỗi trả về thông báo “error” kèm mã trạng thái HTTP phù hợp. Các endpoint danh sách được phân trang bằng page và per_page.

Tài liệu tham chiếu đầy đủ với lược đồ yêu cầu và phản hồi có trong bảng điều khiển của bạn.

Phương thứcEndpointMô tả
GET/linksList links with search and filters
POST/linksTạo liên kết rút gọn
GET/links/{id}Lấy một liên kết
PATCH/links/{id}Update destination, alias or options
DELETE/links/{id}Xóa liên kết
GET/links/{id}/statsClicks, countries, devices and referrers
GET/qrLiệt kê mã QR
POST/qrCreate a dynamic QR code
GET/domainsList your branded domains
GET/campaignsLiệt kê chiến dịch
GET/accountCurrent user and plan usage

Xác minh chữ ký webhook

Mỗi lần gửi đều có header X-ShortGo-Timestamp và X-ShortGo-Signature. Chữ ký là sha256= theo sau là HMAC-SHA256 dạng hex của "timestamp.body" bằng webhook secret của bạn. Hãy so sánh trong thời gian không đổi và từ chối dấu thời gian cũ.

{
  "event": "link.clicked",
  "created_at": "2026-01-01T12:00:00Z",
  "data": {
    "link_id": 42,
    "country": "DE",
    "device": "mobile",
    "referrer": "instagram.com"
  }
}

Chúng tôi dùng cookie thiết yếu để vận hành trang web này. Tìm hiểu thêm