สถิติลิงก์ย่อ GET
ดูรายละเอียดและจำนวนคลิกของลิงก์ย่อหนึ่งลิงก์จาก shortCode — ดูได้เฉพาะลิงก์ของบัญชีคุณ
Authorization
ใช้ API Key (การยืนยันตัวตน) — ส่ง header Authorization: Bearer <API_KEY> (API Key ขึ้นต้นด้วย smsk_)
HTTP Request
http
GET https://public-api.smsup-plus.com/shorten/stats/{code}Content Type
ไม่มี body — ส่งค่าผ่าน path
Parameter Description
| Property | Type | Required | Description |
|---|---|---|---|
code | string (path) | Required | shortCode ที่ได้จาก สร้างลิงก์ย่อ (ตรงตามตัวพิมพ์เล็ก-ใหญ่) |
Response Description
| Property | Type | Description |
|---|---|---|
status | number | 200 เมื่อพบลิงก์ |
data.shortCode | string | รหัสลิงก์ย่อ |
data.originalUrl | string | URL ปลายทาง |
data.domain | string | โดเมนลิงก์ย่อ (ลิงก์เต็ม = domain + shortCode) |
data.messageId | string | ค่า messageId ที่ส่งตอนสร้าง (ว่างถ้าไม่ได้ส่ง) |
data.clickCount | number | จำนวนครั้งที่ลิงก์ถูกเปิด |
data.isActive | boolean | สถานะลิงก์ (true) |
data.createdAt | string | เวลาที่สร้าง (ISO 8601, UTC) |
data.expiresAt | string | ไม่ได้ใช้งาน — ปัจจุบันเป็น 0001-01-01T00:00:00Z เสมอ |
ตัวอย่าง Request
bash
curl -X GET 'https://public-api.smsup-plus.com/shorten/stats/aB3dE9xZ' \
-H 'Authorization: Bearer <API_KEY>'js
const res = await fetch('https://public-api.smsup-plus.com/shorten/stats/aB3dE9xZ', {
headers: { Authorization: 'Bearer <API_KEY>' },
})
console.log(await res.json())ตัวอย่าง Response
json
{
"status": 200,
"data": {
"shortCode": "aB3dE9xZ",
"originalUrl": "https://www.example.com/promotion?utm_source=sms",
"domain": "https://c0c.me/",
"messageId": "PROMO-2026-11",
"clickCount": 37,
"isActive": true,
"createdAt": "2026-11-16T03:15:42.512Z",
"expiresAt": "0001-01-01T00:00:00Z"
}
}Error ที่อาจเจอ
| HTTP | Response | สาเหตุ |
|---|---|---|
| 401 | {"error":"invalid api key"} | API Key ไม่ถูกต้อง — ดู Error |
| 404 | {"status":404,"description":"short URL not found"} | ไม่พบ code นี้, ลิงก์ถูกปิดใช้งานแล้ว หรือลิงก์เป็นของบัญชีอื่น |
TIP
การเรียก endpoint นี้ไม่นับเป็นคลิก — clickCount เพิ่มขึ้นเฉพาะเมื่อมีคนเปิดลิงก์จริงผ่านลิงก์ย่อ
