เอกสารอ้างอิง API
การยืนยันตัวตนPOST

ส่งคำตอบ credential ของ Passkey

ส่งคำตอบ credential WebAuthn ที่ serialize แล้วสำหรับเซสชันการให้สิทธิ์ WhatsApp ที่กำลังทำงาน ส่งสตริง webauthn_response โดยไม่แก้ไข และ poll GET /auth จนเป็น authorized หรือ failed

https://api.unifyport.ai/v1/accounts/{account_id}/auth/passkey-response

ส่วนหัว

X-Api-Key
stringจำเป็น

API key ของพื้นที่ทำงาน ระบบจะระบุพื้นที่ทำงานจากส่วนหัวนี้

Content-Type
stringจำเป็น

ใช้ application/json เมื่อต้องส่งเนื้อหาของคำขอเป็น JSON

พารามิเตอร์ใน path

account_id
stringจำเป็น

ตัวระบุที่ใช้ใน route ของ authentication

เนื้อหาของคำขอ

webauthn_response
stringจำเป็น

คำตอบ credential WebAuthn ที่ serialize แล้ว ส่งสตริงโดยไม่แก้ไขและห้ามบันทึกลง log สาธารณะ

minLength: 1

เนื้อหาการตอบกลับ

account_id
string

บัญชีของผู้ให้บริการที่การตอบกลับนี้อ้างถึง

status
string

สถานะ flow การให้สิทธิ์ปัจจุบัน เช่น pending_auth, awaiting_qr_scan, awaiting_code, pending, passkey_required, passkey_pending, passkey_confirmation, passkey_confirmation_sent, authorized หรือ failed

auth_status
string

สถานะการยืนยันตัวตนมาตรฐานหลัง action ของ Passkey ให้ poll GET /auth จนเป็น authorized หรือ failed

การตอบกลับ

200
200 OK

คำขอสำเร็จ ดูตัวอย่างเนื้อหาตอบกลับด้านบน

400
Bad Request

เนื้อหาของคำขอ path หรือพารามิเตอร์ไม่ถูกต้อง

401
Unauthorized

ส่วนหัว X-Api-Key หายไปหรือไม่ถูกต้อง

409
Conflict

การดำเนินการขัดแย้งกับบัญชีของผู้ให้บริการหรือทรัพยากรที่มีอยู่

500
Internal Server Error

บริการพบข้อผิดพลาดที่ไม่คาดคิด

502
Bad Gateway

อะแดปเตอร์หรือ upstream provider ไม่สามารถทำรายการให้เสร็จได้

คำขอ

curl -X POST https://api.unifyport.ai/v1/accounts/{account_id}/auth/passkey-response \
  -H "X-Api-Key: <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "webauthn_response": "{\"id\":\"<CREDENTIAL_ID>\",\"response\":{\"clientDataJSON\":\"<BASE64URL>\"}}"
}'

การตอบกลับ

{
  "data": {
    "account_id": "acc_example",
    "status": "passkey_pending",
    "auth_status": "passkey_pending"
  }
}