Skip to content

รายการลิงก์ย่อ 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=20

Content Type ​

ไม่มี body — ส่งค่าผ่าน query string

Parameter Description ​

PropertyTypeRequiredDescription
pageinteger (query)Optionalหน้าที่ต้องการ เป็นจำนวนเต็มตั้งแต่ 1 ค่าเริ่มต้น 1
pageSizeinteger (query)Optionalจำนวนรายการต่อหน้า เป็นจำนวนเต็มตั้งแต่ 1 ค่าเริ่มต้น 20 สูงสุด 100 (ค่าที่เกินจะถูกปรับเป็น 100)

Response Description ​

PropertyTypeDescription
statusnumber200 เมื่อสำเร็จ
dataarrayรายการลิงก์ย่อ (ดูตารางด้านล่าง) — อาจเป็น null เมื่อไม่มีข้อมูลในหน้านั้น
totalnumberจำนวนลิงก์ย่อที่ใช้งานได้ทั้งหมดของบัญชี
totalpagenumberจำนวนหน้าทั้งหมด ตาม pageSize

data[] ​

PropertyTypeDescription
shortCodestringรหัสลิงก์ย่อ
originalUrlstringURL ปลายทาง
domainstringโดเมนลิงก์ย่อ (ลิงก์เต็ม = domain + shortCode)
accountIdnumberรหัสบัญชีเจ้าของลิงก์
userIdnumberรหัสผู้ใช้ที่สร้างลิงก์
messageIdstringค่า messageId ที่ส่งตอนสร้าง (ว่างถ้าไม่ได้ส่ง)
clickCountnumberจำนวนครั้งที่ลิงก์ถูกเปิด
isActivebooleanสถานะลิงก์ (รายการนี้แสดงเฉพาะ true)
createdAtstringเวลาที่สร้าง (ISO 8601, UTC)
expiresAtstringไม่ได้ใช้งาน — ปัจจุบันเป็น 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 ที่อาจเจอ ​

HTTPResponseสาเหตุ
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"}ระบบดึงข้อมูลไม่สำเร็จ ลองใหม่อีกครั้ง