API 參考
認證POST

提交 Passkey 憑證回應

WhatsApp QR 流程回傳 passkey_required 時,將瀏覽器產生嘅完整 WebAuthn 憑證回應序列化成 JSON 字串再提交。唔好記錄憑證回應。

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

請求標頭

X-Api-Key
string必填

工作區 API Key,工作區會由呢個標頭解析得出嚟。

Content-Type
string必填

發送 JSON 請求內容嘅時候請用 application/json。

路徑參數

account_id
string必填

用嚟識別嗰條 authentication 路由嘅 ID。

請求內容

webauthn_response
string必填

瀏覽器產生嘅完整 WebAuthn 憑證回應,序列化成 JSON 字串。呢個值係敏感資料,唔好落 log。

minLength: 1

回應內容

account_id
string

呢個回應所指嘅渠道帳號。

status
string

目前授權流程狀態,例如 pending_auth、awaiting_qr_scan、awaiting_code、pending、passkey_required、passkey_pending、passkey_confirmation、passkey_confirmation_sent、authorized 或 failed。

auth_status
string

Passkey 動作回傳嘅標準認證狀態。

回應

200
200 OK

請求成功,回應內容嘅例子如上。

400
請求錯誤

請求內容、路徑或者參數無效。

401
未授權

X-Api-Key 請求標頭缺少或者無效。

409
衝突

目前操作同現有嘅渠道帳號或者資源衝突。

500
伺服器錯誤

服務遇到咗未預期嘅錯誤。

502
上游閘道錯誤

渠道轉接器或者上游渠道未能完成呢個操作。

請求

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"
  }
}