以编程方式访问车辆、费用、提醒、车队成员和活动记录。Base URL:https://api.aufix.app。
概述
- All REST routes are under
/v1/…. - Successful responses use
{ "data": … }. - Errors use
{ "error": { "code": "…", "message": "…" } }. - Operational routes require an active Fleet plan (Fleet, Fleet Pro, or Fleet Max).
- Personal access tokens (PAT) are rate-limited; responses may include
Retry-After.
身份验证
| HTTP | 资源 | 说明 |
|---|
| — | Authorization: Bearer … | 以下每个路由都需要个人访问令牌:Authorization: Bearer aufix_pat_…。请在“设置 → 集成”中创建和撤销密钥(密钥仅显示一次)。read — 仅限 GET;write — 所有方法。 |
车辆
| HTTP | 资源 | 说明 |
|---|
| GET | /v1/vehicles | 列出可访问的车辆。查询参数:limit,游标 after。 |
| POST | /v1/vehicles | 在你的车库中创建车辆。 |
| GET | /v1/vehicles/:vehicleId | 获取单个车辆。 |
| PATCH | /v1/vehicles/:vehicleId | 更新车辆字段。 |
| DELETE | /v1/vehicles/:vehicleId | 删除车辆及其相关记录(所有者)。 |
车辆更新
| HTTP | 资源 | 说明 |
|---|
| GET | /v1/vehicles/:vehicleId/updates | 列出状态更新(里程、燃油/电量、车况、轮胎、备注)。查询参数:limit、afterId + afterAt。 |
| POST | /v1/vehicles/:vehicleId/updates | 为车辆记录一条新的更新。 |
费用
| HTTP | 资源 | 说明 |
|---|
| GET | /v1/expenses | 列出费用(最新的在前)。查询参数:limit、vehicleId,游标 afterId + afterValue。 |
| POST | /v1/expenses | 为车辆创建费用,或创建不关联车辆的个人费用。 |
| PATCH | /v1/expenses/:expenseId | 更新费用。 |
| DELETE | /v1/expenses/:expenseId | 删除费用。 |
提醒
| HTTP | 资源 | 说明 |
|---|
| GET | /v1/reminders | 按到期日期列出提醒。查询参数:limit、vehicleId,游标 afterId + afterValue。 |
| POST | /v1/reminders | 为车辆创建提醒,或创建个人提醒。 |
| PATCH | /v1/reminders/:reminderId | 更新提醒字段(在支持的情况下包括完成状态)。 |
| DELETE | /v1/reminders/:reminderId | 删除提醒。 |
活动
| HTTP | 资源 | 说明 |
|---|
| GET | /v1/activity | 车队所有者的活动日志。查询参数:limit,游标 afterId + afterAt。 |
车队
| HTTP | 资源 | 说明 |
|---|
| GET | /v1/fleet/members | 列出车队成员、角色和车辆分配。 |
| GET | /v1/fleet/invites | 列出車隊邀請。傳回欄位: inviteId, email, role, status, acceptedBy, expiresAt, createdAt, updatedAt, isExpired. |