Assets
Get CRM1 asset export data
/a/Assets_getExportData
Run CRM1’s two-stage Asset export: first select matching IDs, then return requested fields as positional <code>f0</code>, <code>f1</code>, … values.
When to use this endpoint
Use Assets_getExportData only for the legacy configurable CRM1 export contract. First call with _ids=1, then send the returned IDs and a field list.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler requires login or an established tenant database context and performs no additional Asset-page or role-permission check unless the page says otherwise.
Every query and write uses the authenticated tenant’s tables. CRM1 and CRM2 may hide actions through client-side permissions that these collection routes do not repeat.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
_ids | String | Yes | Exact 1 starts the selection pass. Otherwise this must be a JSON array of numeric Asset IDs for the data pass. |
fields | JSON array string | Data pass | Ordered export field names. Each value is returned under its zero-based fN key. |
days-from / days-to | Integer day offsets | No | Selection-pass relative creation-date bounds. |
asset_id / book_id / serial_number / name / search | String | No | Selection filters. ID/name/code values use legacy substring behavior; general search checks book ID, code, type, and name. |
type_id / owner_id | Integer-compatible | No | Exact selection filters. |
location_id / location_type | Integers | No | Exact whereabouts pair. |
warranty | Integer-compatible | No | 1 is after today and 2 is today or earlier. |
whereabouts_not_set | Any | No | Presence selects assets with no whereabouts. |
archived | Integer-compatible | No | Values below 2 apply an exact archive filter; larger values omit it. |
order[0][column] / order[0][dir] | Integer / string | No | Legacy Asset-list ordering for the selection pass. |
Example request
$selection = FM_api('Assets_getExportData', ['_ids' => '1', 'archived' => '0']);
$rows = FM_api('Assets_getExportData', [
'_ids' => json_encode($selection['ids']),
'fields' => json_encode(['asset_id', 'asset_name', 'type_id', 'owner_id', 'last_visited_date']),
]);
Example response
{
"4821": {
"asset_id": "4821",
"owner_id": "1042",
"meta": "{...}",
"f0": "4821",
"f1": "Compressor 4",
"f2": "Compressor",
"f3": "Northwind Service Centre",
"f4": "2026-09-20"
}
}
The selection response is {"ids":[...]}. Data-pass rows are keyed by Asset ID and always include named asset_id, owner_id, and raw meta in addition to the requested positional fields.
Supported fixed fields include identity, name/code/book ID, active/archive/value/type/owner/location/home-location, creation and warranty dates, make/model/vehicle registration/URL/QR, department, last visit, next direct job, job count, and selected metadata. custom:<key> exports an Asset custom value; asset_table:<tableId>_<fieldId> exports legacy table values.
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":"missing or invalid parameter: _ids"} | _ids is absent. |
{"error":"_ids should be a JSON array of numbers"} | The data-pass ID JSON is not a numeric array. |
{"error":"fields should be a JSON array"} | The field list is absent or invalid. |
{"error":"unknown field: ..."} | A requested field is outside the implemented allowlist. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Both passes exclude soft-deleted assets. The data pass only returns existing non-deleted IDs from the supplied array.
- Whereabouts type is rendered as
Area,Customer, orAsset. Home whereabouts is JSON containingtype_id,location_id,name, andtype. - Next-date output is the earliest incomplete direct job in local SQL date-time format. Last-visit output uses completed movement-linked jobs.
See it in Fieldmotion
CRM1
The configurable Assets export widget performs the selection pass, lets the user choose fields, and requests the data pass.
CRM2
No production CRM2 caller was found; CRM2 uses Assets_getAssetTableExportData.
Related endpoints
Assets_exportstreams the fixed legacy CSV.