API การเชื่อมต่อ
API การเชื่อมต่อช่วยให้คุณแสดงรายการและตรวจสอบบัญชีโซเชียลมีเดียที่เชื่อมต่อกับแบรนด์ (Instagram, Threads, Bluesky, Facebook Page, TikTok และ YouTube) ใช้ API นี้เพื่อดู connection_id เป้าหมายและตรวจสอบสิทธิ์ก่อนเผยแพร่เนื้อหา
📌 Endpoint
หัวข้อที่มีชื่อว่า “📌 Endpoint”| เมธอด | พาธ | คำอธิบาย | ขอบเขตสิทธิ์ที่จำเป็น |
|---|---|---|---|
GET | /v1/brand/connections | รายชื่อบัญชี SNS ที่เชื่อมต่อ พร้อมตัวกรองแพลตฟอร์ม | connections:read หรือ * |
GET | /v1/brand/connections/{connection_id} | ดึงรายละเอียดการเชื่อมต่อและผลตรวจสอบสิทธิ์ปัจจุบัน | connections:read หรือ * |
📋 รายการการเชื่อมต่อ (GET /v1/brand/connections)
หัวข้อที่มีชื่อว่า “📋 รายการการเชื่อมต่อ (GET /v1/brand/connections)”ดึงบัญชี SNS ทั้งหมดที่เชื่อมต่ออยู่ภายใต้แบรนด์
พารามิเตอร์ของคำขอ
หัวข้อที่มีชื่อว่า “พารามิเตอร์ของคำขอ”| พารามิเตอร์ | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|
sns_type | string | ไม่จำเป็น | กรองตาม instagram, threads, bluesky, facebook_page, tiktok หรือ youtube |
ตัวอย่างคำขอ
หัวข้อที่มีชื่อว่า “ตัวอย่างคำขอ”curl -X GET "https://api.ankk.app/v1/brand/connections?sns_type=instagram" \ -H "Authorization: Bearer spk_live_xxxxxxxx"ตัวอย่างการตอบกลับ (200 OK)
หัวข้อที่มีชื่อว่า “ตัวอย่างการตอบกลับ (200 OK)”{ "items": [ { "id": "conn_01jm8x9k2example", "sns_type": "instagram", "platform": "meta.instagram", "display_name": "ACME Official", "username": "acme_official", "profile_image_url": "https://example.com/profiles/acme.jpg", "status": "connected", "created_at": "2026-08-01T10:00:00Z" } ]}🔍 ดึงรายละเอียดการเชื่อมต่อ (GET /v1/brand/connections/{connection_id})
หัวข้อที่มีชื่อว่า “🔍 ดึงรายละเอียดการเชื่อมต่อ (GET /v1/brand/connections/{connection_id})”ดึงรายละเอียดการเชื่อมต่อพร้อมผลตรวจสอบ สิทธิ์การเผยแพร่ ปัจจุบัน
ตัวอย่างคำขอ
หัวข้อที่มีชื่อว่า “ตัวอย่างคำขอ”curl -X GET "https://api.ankk.app/v1/brand/connections/conn_01jm8x9k2example" \ -H "Authorization: Bearer spk_live_xxxxxxxx"ตัวอย่างการตอบกลับ (200 OK)
หัวข้อที่มีชื่อว่า “ตัวอย่างการตอบกลับ (200 OK)”{ "id": "conn_01jm8x9k2example", "sns_type": "instagram", "platform": "meta.instagram", "display_name": "ACME Official", "username": "acme_official", "profile_image_url": "https://example.com/profiles/acme.jpg", "status": "connected", "created_at": "2026-08-01T10:00:00Z", "publish_authorization": { "status": "scope_authorized", "required_scopes": ["instagram_business_basic", "instagram_business_content_publish"], "missing_scopes": [], "retryable": false }}รหัสสถานะการอนุญาต (publish_authorization.status)
หัวข้อที่มีชื่อว่า “รหัสสถานะการอนุญาต (publish_authorization.status)”| สถานะ | ความหมายและการดำเนินการ |
|---|---|
scope_authorized | ได้รับการอนุญาตครบถ้วน พร้อมสำหรับการเผยแพร่ |
scope_permission_unverified | อยู่ระหว่างการตรวจสอบ สามารถลองเผยแพร่ได้ |
scope_permission_missing | ขาดขอบเขตสิทธิ์ที่จำเป็น ต้องยืนยันตัวตนใหม่ผ่าน Web UI |
scope_review_disabled | ถูกบล็อกโดยสถานะการตรวจสอบแอปของแพลตฟอร์มหรือขีดจำกัดโหมดนักพัฒนา |
unsupported | ไม่รองรับการดำเนินการนี้ในการเชื่อมต่อนี้ |