快速開始
先認證,再讀取評分。
每個請求帶一個 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/v1200 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/tripsList 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-breakdownTheme-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 物件。
行程是評分的單位。以下是大多數整合會讀取的欄位 — 完整結構見參考文件。
| 欄位 | 類型 | 說明 |
|---|---|---|
tripId | string | Stable identifier for the trip. |
overallScore | number | AURA score for the trip, 0–100. Higher is safer. |
tier | string | Derived band: Critical (<45), Fair (<65), Good (<80), Safe. |
mapMatched | boolean | Whether the trip was map-matched to the road network. |
distanceKm | number | Trip distance in kilometres. |
durationMin | number | Trip duration in minutes. |
startDate | string | ISO 8601 start timestamp. |
vehicle | string | Vehicle 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 — 所有機械類型用同一組區間。
