Report Builder
Get Report Schema
Retrieve available fields, modes, and filters for a report type.
GET/api/v1/workspace/reports/schema
Use this to discover which fields are available before calling Query Report.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
reportType | string | Required | timeline, time-allocation, statistics, job-report, mileage-report |
mode | string | Optional | by_user (default) or by_place |
Example
Request
curl -X GET \
"https://live.fleetwork.vn/api/v1/workspace/reports/schema?reportType=job-report&mode=by_user" \
-H "API-KEY: <your-key>"Response
{
"code": "OK",
"message": null,
"data": {
"reportType": "job-report",
"mode": "by_user",
"supportedModes": ["by_user", "by_place"],
"supportedFilters": ["fromTime", "toTime", "userId", "placeId"],
"fields": [
{
"field": "taskName",
"label": "Tên nhiệm vụ",
"engLabel": "Task Name",
"dataType": "string",
"isDefault": true
},
{
"field": "status",
"label": "Trạng thái",
"engLabel": "Status",
"dataType": "int",
"isDefault": true
},
{
"field": "completedAt",
"label": "Hoàn thành lúc",
"engLabel": "Completed At",
"dataType": "datetime",
"isDefault": false
}
]
}
}Use the field values from the response as the fields array in Query Report.