Vehicles
List vehicle registrations
/a/Vehicles_getReges
Return lightweight numeric vehicle IDs, registrations, and edit timestamps for selectors and exports.
When to use this endpoint
Use Vehicles_getReges when a stock/export workflow needs registration labels without loading full vehicle rows. It supports either a changed-since window or a selected ID batch.
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 |
|---|---|---|---|
last_edited | Datetime string | No | When nonblank, selects rows with last_edited >= this literal value and last_edited < the current server datetime. This branch takes precedence over ids. |
ids | JSON array or native array | No | Numeric vehicle IDs. Values are integer-converted and deduplicated. A non-array decoded value returns a structured error. Omit both parameters to return every vehicle. |
Example request
$vehicles = FM_api('Vehicles_getReges', [
'ids' => json_encode(['30124', '30125']),
]);
Example response
[{"id":"30124","reg":"241-D-12001","last_edited":"2026-10-01 11:20:00"},{"id":"30125","reg":"241-D-12002","last_edited":"2026-10-01 12:05:00"}]
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. |
{"error":"parameter should be a JSON array of IDs: ids"} | ids is present but is neither a native array nor valid JSON decoding to an array. |
false or a database-query error | An explicit empty ID array creates the legacy empty IN query. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- There is no pagination or explicit ordering.
- The changed-since lower bound is inclusive, so callers may see the checkpoint row again. The upper bound excludes edits at or after the handler’s current server time.
- An empty or false-like
last_editeddoes not activate the date branch.
See it in Fieldmotion
CRM1
CRM1 loads this endpoint for stock vehicle selectors, job-export vehicle labels, and a header-level vehicle cache.
CRM2
CRM2 uses it for export label resolution and the same header vehicle cache. Filter developer tools for Vehicles_getReges while opening affected stock/export controls.
Related endpoints
Vehicles_listsupports optional raw fields but has a different strict changed-since boundary.Vehicles_getByIdretrieves fuller rows for selected IDs.