跳轉到主要內容

WIDTH Identity 開發者文檔

WIDTH Identity 提供完整的身份核驗與合規平臺,覆蓋 KYC、KYB、交易篩查與持續監控全流程 — 透過 REST API 與適配 Web、iOS、Android 的 SDK 接入。

核心能力

平臺提供四類核心合規工作流。每類均可透過 REST API 呼叫,大部分同時支援 SDK 接入。

整合方式

提供三種整合方式。需要完整後端控制時使用 OpenAPI;希望快速獲得託管核驗體驗時使用 SDK。

方式最適合支援工作流
OpenAPI(REST,伺服器到伺服器) 已自行採集客戶資料,需要完整後端控制 UX。 KYC、KYB、交易篩查、持續監控
移動 SDK(Android、iOS) 移動應用中開箱即用的核驗體驗,程式碼最少。 KYC、KYB
Web SDK Web 應用中即插即用的模態框或新頁籤核驗。 KYC、KYB、單次活體檢測
提示。 Most teams use the SDK for end-user verification and the OpenAPI for backend operations (transaction screening, monitoring, decisions). The two work together — both write to the same workflow engine and share the same audit trail.

環境

提供兩套環境:用於開發的 staging(測試環境)與承載真實流量的 production(生產環境)。所有 staging URL 以 -stg 結尾。

資源測試環境生產環境
API Gatewayhttps://one-gateway-api-stg.width.com/gatewayhttps://one-gateway-api.width.com/gateway
Storage Servicehttps://one-gateway-api-stg.width.com/storagehttps://one-gateway-api.width.com/storage
Platform Consolehttps://one-platform-stg.width.comhttps://one-platform.width.com

憑證

根據整合方式不同,提供兩類憑證。

型別使用場景欄位
OPENAPI伺服器到伺服器 APIapiKey (prefixed ak_) + apiSecret (prefixed sk_)
SDKWeb/移動 SDKappId + apiKey + per-session sdkToken

如何獲取

  1. 登入 One Platform Console → API & Integration
  2. 點選 Generate 生成金鑰對。
  3. 複製並安全儲存憑證。apiSecret 僅顯示一次。
切勿將 apiSecret 硬編碼到原始碼中。請使用環境變數或金鑰管理服務。如果金鑰洩露,請立即在控制台旋轉。

快速開始 — 請求簽名

每個 OpenAPI 請求都使用 HMAC-SHA256 對請求體進行簽名,簽名透過 sign 查詢引數附加傳遞。

sign = HmacSHA256(apiSecret, requestBody)

金鑰與請求體均使用 UTF-8 編碼,簽名結果為 64 位小寫十六進位制字串。

import hmac, hashlib

sign = hmac.new(
    api_secret.encode('utf-8'),
    request_body.encode('utf-8'),
    hashlib.sha256
).hexdigest()
const crypto = require('crypto');

const sign = crypto
  .createHmac('sha256', apiSecret)
  .update(requestBody, 'utf8')
  .digest('hex');
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(apiSecret.getBytes("UTF-8"), "HmacSHA256"));
byte[] hash = mac.doFinal(requestBody.getBytes("UTF-8"));
String sign = HexFormat.of().formatHex(hash);

請參閱 身份驗證參考 獲取完整請求信封,包括請求頭、查詢引數與示例。

下一步:選擇一個工作流