Documentation Index
Fetch the complete documentation index at: https://developers.zangsho.com/llms.txt
Use this file to discover all available pages before exploring further.
認證方式
帳獸 API 使用 Bearer Token 進行認證。每個 API 請求都必須在Authorization 標頭中附帶有效的 Token。
取得 Token
你可以在後台的金鑰管理頁面建立 API Token。詳見 API 金鑰管理。Token 只會在建立時顯示一次,請立即複製並妥善保存。
使用範例
認證失敗
如果 Token 無效、已過期或未提供,API 會回傳401 Unauthorized:
常見原因
| 原因 | 說明 |
|---|---|
| 未附帶 Token | 請求未包含 Authorization 標頭 |
| Token 格式錯誤 | 確認格式為 Bearer YOUR_TOKEN(注意 Bearer 後有空格) |
| Token 已撤銷 | Token 已被手動撤銷,需建立新的 |
| Token 已重新生成 | 重新生成後舊 Token 立即失效 |
Token 權限
每個 Token 包含以下 abilities:| 權限 | 說明 | 對應端點 |
|---|---|---|
customers:read | 讀取客戶資料 | GET /customers, GET /customers/{id} |
customers:write | 建立、更新、刪除客戶 | POST /customers, PUT /customers/{id}, DELETE /customers/{id} |
orders:read | 讀取訂單資料 | GET /orders, GET /orders/{orderNo}, GET /orders/stats |
orders:write | 建立訂單 | POST /orders |
subscriptions:read | 讀取訂閱資料 | GET /subscriptions, GET /subscriptions/{id} |
subscriptions:write | 建立、更新、刪除訂閱 | POST /subscriptions, PUT /subscriptions/{id}, DELETE /subscriptions/{id} |
403 Forbidden。