Vehicles
Query mapped vehicle details
/a/Vehicle_getRequestedDetails
Query selected mapped vehicle fields, including formatted creation time and nested custom values.
When to use this endpoint
Use Vehicle_getRequestedDetails for CRM2 layouts, entity history labels, or integrations that want camelCase mapped fields rather than raw database columns.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler requires login but performs no additional Vehicles-page, create, edit, delete, or role-permission check.
All reads and writes use the authenticated tenant’s tables. CRM1 and CRM2 may hide controls through client-side permissions; these routes do not repeat those UI checks.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fields | Native array | No | Mapped fields to return from id, uuID, name, reg, description, costPerDistance, location, lastEdited, editedUUID, pricePerDistance, meta, cDate, and customValues. Omission requests every mapped field; unknown names are ignored and id is always included. |
id / ids | Integer-compatible or native array | No | Optional numeric ID filter. id takes precedence over ids; scalar values are integer-converted. Without either, every vehicle can be returned. |
name, reg, uuID, description, location, lastEdited, editedUUID, meta, customValues | Scalar or native array | No | Exact, case-insensitive mapped filters. Arrays become IN filters. name and reg both address the registration column. |
costPerDistance, pricePerDistance, cDate | Scalar or native array | No | Exact numeric filters. Scalar decimal costs are integer-truncated by the shared detail reader; array values are also integer-converted, so fractional filtering is unreliable. |
order | Native array | No | Mapped order fields, either names or objects such as [{"id":"name","dir":"desc"}]. No order is applied when omitted. |
Example request
$rows = FM_api('Vehicle_getRequestedDetails', [
'id' => ['30124'],
'fields' => ['id', 'name', 'description', 'costPerDistance', 'pricePerDistance', 'cDate', 'customValues'],
]);
Example response
[{
"id": "30124",
"name": "241-D-12001",
"description": "Service van",
"costPerDistance": "0.4200",
"pricePerDistance": "0.7500",
"cDate": "2026-10-01 11:20:00",
"customValues": {"cost-centre":"Service"}
}]
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
[] | No row matches, an ID array contains no usable IDs, or filters exclude every row. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- This route has no pagination or implicit ordering. Omitting ID and field filters reads the entire vehicle table.
cDateis converted from Unix time to a database datetime string.lastEditedis already stored as a datetime.- Asking for both
nameandregreturns the same registration value under both keys. customValuesis extracted frommeta.custom_values; the regression test verifies associative values round-trip through mapped updates.
See it in Fieldmotion
CRM1
No direct CRM1 caller was found; CRM1 uses Vehicle_get for its edit dialog.
CRM2
CRM2’s vehicle create/edit layouts and vehicle history widgets resolve this endpoint through the shared vehicle layout mapping. Filter developer tools for Vehicle_getRequestedDetails while opening a vehicle.
Related endpoints
Vehicle_updateDatawrites the same mapped field names.Vehicles_getDataTableadds search and pagination for table screens.