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

ParameterTypeRequiredDescription
fieldsNative arrayNoMapped 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 / idsInteger-compatible or native arrayNoOptional 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, customValuesScalar or native arrayNoExact, case-insensitive mapped filters. Arrays become IN filters. name and reg both address the registration column.
costPerDistance, pricePerDistance, cDateScalar or native arrayNoExact numeric filters. Scalar decimal costs are integer-truncated by the shared detail reader; array values are also integer-converted, so fractional filtering is unreliable.
orderNative arrayNoMapped 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

ResponseCondition
{"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.
  • cDate is converted from Unix time to a database datetime string. lastEdited is already stored as a datetime.
  • Asking for both name and reg returns the same registration value under both keys.
  • customValues is extracted from meta.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