認證方式

IPFast API 使用 API Key 進行認證。每個請求都需要在 HTTP Header 中包含您的 API Key。

API Key 認證

在每個 API 請求的 Header 中添加CODE和TOKEN字段:

--header 'x-merchant-token: CODE'
--header 'x-merchant-code: TOKEN'

示例:

fetch('/api/ipft/simple/check', {
  headers: {
    'x-merchant-token': 'YOU TOKEN',
    'x-merchant-code': 'YOU CODE'
  }
})

示例輸出:

{"msg":"驗證成功,歡迎使用","code":200}

獲取 API Key

  1. 登入您的 IPFast 帳戶
  2. 進入控制面板的 API 設置頁面
  3. 生成新的 API Key

API Key 設置頁面

安全建議

  • 請妥善保管您的 API Key,不要洩露給他人
  • 定期更換 API Key 以提高安全性
  • 不要在客戶端代碼中硬編碼 API Key
  • 如果懷疑 API Key 洩露,請立即重新生成