API ลิงก์สั้น - เอกสาร

API JSON สำหรับสร้างและตรวจสอบลิงก์สั้น ใช้คีย์ API ที่ออกให้บัญชีคุณ (หรือ API_TOKEN ของแพลตฟอร์มหากใช้ได้)

API สาธารณะ: https://anyurl.bond - JSON ที่ /api/v1/

Authorization

Authorization: Bearer 1234

ส่งคีย์ API ที่ถูกต้องใน Authorization: Bearer การเข้าสู่ระบบแดชบอร์ดใช้คีย์เดียวกันกับอีเมล

POST /api/v1/shorten

{"long_url":"https://example.com","expiration_time":"24h","max_uses":100,"allow_bots":false}
{"long_url":"https://example.com","permanent":true}

expiration_time และ max_uses เป็นทางเลือกสำหรับแพ็กเกจแบบชำระ หากยังไม่ชำระมีเพดานรายเดือนตามปฏิทิน (UTC รีเซ็ตวันที่ 1) และแต่ละลิงก์หมดอายุประมาณ 10 นาทีโดยไม่ขึ้นกับเนื้อหาคำขอ

GET /api/v1/info/{short_code}

คืนข้อมูลเมตาและความถูกต้องของรหัสสั้นโดยไม่เพิ่มจำนวนคลิก

GET /api/v1/me

คืนแพ็กเกจ ขีดจำกัดจริงจากแผง และการใช้งานเดือนนี้ (UTC): ลิงก์ใหม่กับการแก้ API

GET /api/v1/links

?limit=50&offset=0

แสดงเฉพาะลิงก์สั้นที่สร้างด้วยคีย์ API ของบัญชีคุณ (owner_id ตรงกับคีย์นั้น ขอบเขตเดียวกับ GET /info) โทเค็น API ของแพลตฟอร์มใช้เอนด์พอยต์นี้ไม่ได้ พารามิเตอร์เสริม: limit (ค่าเริ่ม 50 สูงสุด 100) offset (ค่าเริ่ม 0 สูงสุด 100000) JSON: links (ฟิลด์เดียวกับ GET /info ต่อรายการ) total limit offset รายการไม่ลบแถวหรือเพิ่มคลิก

PUT / PATCH /api/v1/info/{short_code}

{"long_url":"https://example.com/new","expiration_time":"24h","max_uses":20,"allow_bots":false}

เปลี่ยนรหัสสั้นที่มีอยู่ใช้ PUT หรือ PATCH ที่ /api/v1/info/{short_code} ไม่ใช่ POST /shorten เนื้อ JSON: long_url expiration_time max_uses allow_bots มิฉะนั้นหากไม่ส่งฟิลด์จะคงเดิม ล้างหมดอายุตามเวลาด้วย expiration_time "" จำกัดการใช้ไม่จำกัดด้วย max_uses -1 รูปแบบตอบกลับเหมือน GET /info

ตัวอย่างบรรทัดคำสั่ง (curl)

โทเค็น 1234 เป็นตัวอย่าง - ใช้คีย์ API จริงของคุณ โฮสต์: https://anyurl.bond

POST /api/v1/shorten - JSON เต็ม (โฮสต์ https://anyurl.bond)
curl
curl -sS -X POST 'https://anyurl.bond/api/v1/shorten' \
  -H 'Authorization: Bearer 1234' \
  -H 'Content-Type: application/json' \
  -d "{\"long_url\":\"https://example.com\",\"expiration_time\":\"24h\",\"max_uses\":100,\"allow_bots\":false}"
POST /api/v1/shorten - บอดี้ขั้นต่ำ (แบบชำระ: ค่าเริ่มหมดอายุ 24 ชม.)
curl
curl -sS -X POST 'https://anyurl.bond/api/v1/shorten' \
  -H 'Authorization: Bearer 1234' \
  -H 'Content-Type: application/json' \
  -d "{\"long_url\":\"https://example.com\"}"
POST /api/v1/shorten - ถาวร (แบบชำระ; ใช้โควต้าแก้ไขอัจฉริยะหนึ่งครั้ง)
curl
curl -sS -X POST 'https://anyurl.bond/api/v1/shorten' \
  -H 'Authorization: Bearer 1234' \
  -H 'Content-Type: application/json' \
  -d "{\"long_url\":\"https://example.com\",\"permanent\":true}"
GET /api/v1/info/{short_code} - ตัวอย่างรหัสสั้น abc123
curl
curl -sS 'https://anyurl.bond/api/v1/info/abc123' \
  -H 'Authorization: Bearer 1234'
GET /api/v1/me
curl
curl -sS 'https://anyurl.bond/api/v1/me' \
  -H 'Authorization: Bearer 1234'
GET /api/v1/links - แบ่งหน้ารายการลิงก์สั้นของคุณ
curl
curl -sS 'https://anyurl.bond/api/v1/links?limit=50&offset=0' \
  -H 'Authorization: Bearer 1234'
PATCH /api/v1/info/{short_code}
curl
curl -sS -X PATCH 'https://anyurl.bond/api/v1/info/abc123' \
  -H 'Authorization: Bearer 1234' \
  -H 'Content-Type: application/json' \
  -d "{\"long_url\":\"https://example.com/updated-destination\"}"
PUT /api/v1/info/{short_code}
curl
curl -sS -X PUT 'https://anyurl.bond/api/v1/info/abc123' \
  -H 'Authorization: Bearer 1234' \
  -H 'Content-Type: application/json' \
  -d "{\"long_url\":\"https://example.com/updated\",\"expiration_time\":\"7d\",\"max_uses\":50,\"allow_bots\":true}"
Verbose (-v) สำหรับดีบัก
curl
curl -v -X POST 'https://anyurl.bond/api/v1/shorten' \
  -H 'Authorization: Bearer 1234' \
  -H 'Content-Type: application/json' \
  -d "{\"long_url\":\"https://example.com\"}"

API แบบฟรี: ลิงก์สั้นใหม่สูงสุด 100 รายการต่อเดือนปฏิทิน (UTC) โควต้ารีเซ็ตวันที่ 1 ของเดือน แต่ละลิงก์หมดอายุประมาณ 10 นาที แพ็กเกจแบบเสียเงินใช้รอบเดือนเดียวกัน

กลับหน้าแรก · ข้อกำหนดและเงื่อนไข