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 路由的識別字。

請求內容

webauthn_response
string必填

瀏覽器產生的完整 WebAuthn 憑證回應,序列化為 JSON 字串。此值屬於敏感資訊,切勿寫入記錄。

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