认证POST
提交 Passkey 凭证响应
当 WhatsApp QR 流程返回 passkey_required 时,将浏览器生成的完整 WebAuthn 凭证响应序列化为 JSON 字符串后提交。切勿记录凭证响应。
https://api.unifyport.ai/v1/accounts/{account_id}/auth/passkey-response请求头
X-Api-Keystring必填
工作区 API Key,工作区由该请求头解析得到。
Content-Typestring必填
发送 JSON 请求体时使用 application/json。
路径参数
account_idstring必填
用于该 authentication 路由的标识符。
请求体
webauthn_responsestring必填
浏览器生成的完整 WebAuthn 凭证响应,序列化为 JSON 字符串。该值属于敏感信息,切勿落日志。
minLength: 1
响应体
account_idstring
该响应所对应的渠道账号。
statusstring
当前授权流程状态,例如 pending_auth、awaiting_qr_scan、awaiting_code、pending、passkey_required、passkey_pending、passkey_confirmation、passkey_confirmation_sent、authorized 或 failed。
auth_statusstring
Passkey 动作返回的标准认证状态。
响应
200200 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"
}
}