開發者 · Events API

REST · 基於 HTTP 的 JSON

Events API。

透過 HTTP 讀取已評分行程、GPS 路線同因子層級的 AURA 拆解。遙測由 SDK 同認證連接器於邊緣採集;API 把已評分、可解釋的結果交給你的系統。AURA 支援核保 — 持牌保險公司保留定價權限。

快速開始

先認證,再讀取評分。

每個請求帶一個 bearer token 同可選的車隊範圍。回應為 JSON,附頂層 ok 旗標。

認證

在 Authorization 標頭傳入 bearer token。以可選的 x-fleet-id 標頭把請求範圍限定於單一車隊;省略則管理員 token 可見其擁有的所有車隊。

cURL · authenticated request
curl https://api.yas.dev/v1/trips \
  -H "Authorization: Bearer $YAS_TOKEN" \
  -H "x-fleet-id: fleet_joie"

# Base URL
# Sandbox  https://api.sandbox.yas.dev/v1
# Productionhttps://api.yas.dev/v1
200 OK · application/json
{
  "ok": true,
  "trips": [
    { "tripId": "trip_2026_0142", "overallScore": 72.4, "tier": "Good" }
  ],
  "pagination": { "page": 1, "limit": 20, "totalPages": 9, "total": 172 }
}

參考

核心端點。

面向行程、路線、評分同車輛的唯讀端點。接入透過 SDK 同連接器進行,而非公開寫入端點。

  • GET/v1/trips

    List scored trips, newest first, with pagination and fleet scope.

  • GET/v1/trips/{id}

    Retrieve a single trip with its summary metrics and GPS link.

  • GET/v1/trips/{id}/score-breakdown

    Theme-by-factor AURA score breakdown for one trip.

  • GET/v1/vehicles/{plate}

    Vehicle risk profile and driver roster.

範例

取得行程評分拆解。

拆解把約 100 項風險因子歸入六大主題,各有自己的子分數,並指出最弱主題,讓你知道應在何處改善。

GET /v1/trips/{id}/score-breakdown
{
  "ok": true,
  "breakdown": {
    "tripId": "trip_2026_0142",
    "overallScore": 72.4,
    "mapMatched": true,
    "themes": [
      {
        "id": "speeding", "label": "Speeding",
        "themeScore": 68.2,
        "factors": [
          { "key": "speedingIntensity", "score": 71.5 }
        ]
      }
    ],
    "weakestTheme": { "id": "speeding", "label": "Speeding" }
  }
}

資料模型

Trip 物件。

行程是評分的單位。以下是大多數整合會讀取的欄位 — 完整結構見參考文件。

欄位說明
tripIdStable identifier for the trip.
overallScoreAURA score for the trip, 0–100. Higher is safer.
tierDerived band: Critical (<45), Fair (<65), Good (<80), Safe.
mapMatchedWhether the trip was map-matched to the road network.
distanceKmTrip distance in kilometres.
durationMinTrip duration in minutes.
startDateISO 8601 start timestamp.
vehicleVehicle plate or unit identifier.

慣例

設計上可預測。

錯誤

失敗回傳 ok: false 附 error 字串同慣用 HTTP 狀態碼 — 400、401、403、404、429 或 500。

分頁

列表端點接受 page 同 limit(10–100),並回傳含 page、limit、totalPages 同 total 的 pagination 區塊。

車隊範圍

x-fleet-id 標頭把讀取限定於單一車隊。範圍不符回傳 404 — 絕不洩漏其他車隊的數據。

評分等級

等級由單一尺度衍生:Critical、Fair、Good、Safe — 所有機械類型用同一組區間。

對著沙盒開發。

合資格試點獲得沙盒憑證同參考文件。告訴我們你的整合介面同市場。