giip

API 公共結果代碼 (RstVal)

本文檔介紹 GIIP 平台 API 公共響應欄位

RstVal
RstMsg
的標準定義。

📋 概述

為了追蹤執行結果,所有 GIIP API 都會在響應數據的最頂層包含

RstVal
(整型代碼)和
RstMsg
(描述性消息)。這些值遵循數據庫中
tDefRst
(結果定義)表的標準。

用戶提到的 tRstVal 指的是 tDefRst 表中的 drRstVal 欄位。開發者在進行 API 對接和開發時,可以參考以下定義的代碼來實現異常處理。


📡 主要結果代碼 (Major Codes)

RstValRstMsg含義備註
200Process has done successfully成功標準成功響應
400No data found請求錯誤缺少參數或數據為空
401Unauthorized認證失敗憑證錯誤或會話已過期
403Forbidden無權限訪問權限不足
404No data found未找到資源不存在
500System error系統錯誤服務器內部邏輯或數據庫錯誤

🔍 詳細結果代碼列表 (tDefRst)

系統內部使用的詳細結果代碼列表,包含針對積分、註冊、外部對接等特定領域的詳細消息。

drRstValdrRstMsg類別
100Starting Stored Procedure...系統
102Data is not match校驗
201Created successfully創建
204No content available數據
211It is clean email. go next...註冊
212Already registered user.註冊
220Charge process has done successfully支付/積分
221Point process has done successfully積分
230Buying process has done successfully購買
250Prayed successfully其他
300Permission error權限
301Not enough point積分
302Already data exists.重複
312Pre-registered but not have User data.註冊狀態
313Input status is lower than dbStatus.一致性
320It cannot be processed point processing積分
330You have NFT Token already.資產
332Already sold out.購買
333Event item limit reached.活動
390Already registered this wallet.認證/錢包
405Method not allowed服務器/HTTP
409Conflict: Resource already exists狀態衝突
410Gone: Resource no longer available已失效/已刪除
420You don't have enough point積分
421Not same point and point history.數據一致性
502Bad Gateway: Upstream error網絡

💡 開發者建議

  • 判定成功: 建議僅在
    RstVal
    200
    時繼續執行業務邏輯。
  • 錯誤處理:
    400
    系列代碼通常表示客戶端需要修正請求,而
    500
    系列代碼則需要系統管理員介入檢查。
  • 消息使用:
    RstMsg
    主要用於開發者調試。對於最終用戶,建議根據其語言環境實現對應的提示邏輯。

疑難排解

症狀原因解決
API 回應返回
RstVal
401
憑證錯誤或會話已過期重新確認認證金鑰並刷新會話後重新發送請求。
RstVal
400
404
且數據為空
缺少必填參數或請求的資源不存在檢查請求參數,並使用有效且存在的資源識別符重新請求。
RstVal
301
/
420
導致處理中斷
未滿足積分不足等業務條件查看
RstMsg
(如 Not enough point),滿足前置條件後重試。
RstVal
返回
500
/
502
伺服器內部邏輯/資料庫錯誤或上游閘道錯誤請勿在用戶端重試,攜帶
RstMsg
聯繫系統管理員。

相關文檔: