รายการลิงก์ย่อ GET
ดึงรายการลิงก์ย่อที่ยังใช้งานได้ของบัญชีคุณ เรียงจากสร้างล่าสุดก่อน แบ่งหน้าได้
Authorization
ใช้ API Key (การยืนยันตัวตน) — ส่ง header Authorization: Bearer <API_KEY> (API Key ขึ้นต้นด้วย smsk_)
HTTP Request
http
GET https://public-api.smsup-plus.com/shorten/list?page=1&pageSize=20Content Type
ไม่มี body — ส่งค่าผ่าน query string
Parameter Description
| Property | Type | Required | Description |
|---|---|---|---|
page | integer (query) | Optional | หน้าที่ต้องการ เป็นจำนวนเต็มตั้งแต่ 1 ค่าเริ่มต้น 1 |
pageSize | integer (query) | Optional | จำนวนรายการต่อหน้า เป็นจำนวนเต็มตั้งแต่ 1 ค่าเริ่มต้น 20 สูงสุด 100 (ค่าที่เกินจะถูกปรับเป็น 100) |
Response Description
| Property | Type | Description |
|---|---|---|
status | number | 200 เมื่อสำเร็จ |
data | array | รายการลิงก์ย่อ (ดูตารางด้านล่าง) — อาจเป็น null เมื่อไม่มีข้อมูลในหน้านั้น |
total | number | จำนวนลิงก์ย่อที่ใช้งานได้ทั้งหมดของบัญชี |
totalpage | number | จำนวนหน้าทั้งหมด ตาม pageSize |
data[]
| Property | Type | Description |
|---|---|---|
shortCode | string | รหัสลิงก์ย่อ |
originalUrl | string | URL ปลายทาง |
domain | string | โดเมนลิงก์ย่อ (ลิงก์เต็ม = domain + shortCode) |
accountId | number | รหัสบัญชีเจ้าของลิงก์ |
userId | number | รหัสผู้ใช้ที่สร้างลิงก์ |
messageId | string | ค่า messageId ที่ส่งตอนสร้าง (ว่างถ้าไม่ได้ส่ง) |
clickCount | number | จำนวนครั้งที่ลิงก์ถูกเปิด |
isActive | boolean | สถานะลิงก์ (รายการนี้แสดงเฉพาะ true) |
createdAt | string | เวลาที่สร้าง (ISO 8601, UTC) |
expiresAt | string | ไม่ได้ใช้งาน — ปัจจุบันเป็น 0001-01-01T00:00:00Z เสมอ (ลิงก์ไม่มีวันหมดอายุ) |
ตัวอย่าง Request
bash
curl -X GET 'https://public-api.smsup-plus.com/shorten/list?page=1&pageSize=20' \
-H 'Authorization: Bearer <API_KEY>'js
const res = await fetch('https://public-api.smsup-plus.com/shorten/list?page=1&pageSize=20', {
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/",
"accountId": 1024,
"userId": 2048,
"messageId": "PROMO-2026-11",
"clickCount": 37,
"isActive": true,
"createdAt": "2026-11-16T03:15:42.512Z",
"expiresAt": "0001-01-01T00:00:00Z"
}
],
"total": 1,
"totalpage": 1
}Error ที่อาจเจอ
| HTTP | Response | สาเหตุ |
|---|---|---|
| 401 | {"error":"invalid api key"} | API Key ไม่ถูกต้อง — ดู Error |
| 400 | {"status":400,"description":"page and pageSize must be positive integers"} | page หรือ pageSize ไม่ใช่ตัวเลข, เป็น 0 หรือติดลบ |
| 500 | {"status":500,"description":"failed to query URLs"} | ระบบดึงข้อมูลไม่สำเร็จ ลองใหม่อีกครั้ง |
