快速入门
进行身份验证,然后读取分数。
每个请求都带有一个不记名令牌和一个可选的车队范围。响应为 JSON 并带有顶级 ok 标志。
认证
在授权标头中传递不记名令牌。使用可选的 x-fleet-id 标头将请求范围限定为一个队列;省略它,管理令牌会看到他们拥有的每个车队。
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 并带有错误字符串和常规 HTTP 状态 — 400、401、403、404、429 或 500。
分页
列表端点获取页面和限制(10-100)并返回包含页面、限制、totalPages 和总计的分页块。
机队范围
x-fleet-id 标头范围读取一组。不匹配的范围会返回 404 — 不会返回其他队列的数据。
分数等级
等级源自一个等级:关键、公平、良好、安全——每种机器类型的等级相同。
