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

ParameterTypeRequiredDescription
_idsStringYesExact 1 starts the selection pass. Otherwise this must be a JSON array of numeric Asset IDs for the data pass.
fieldsJSON array stringData passOrdered export field names. Each value is returned under its zero-based fN key.
days-from / days-toInteger day offsetsNoSelection-pass relative creation-date bounds.
asset_id / book_id / serial_number / name / searchStringNoSelection filters. ID/name/code values use legacy substring behavior; general search checks book ID, code, type, and name.
type_id / owner_idInteger-compatibleNoExact selection filters.
location_id / location_typeIntegersNoExact whereabouts pair.
warrantyInteger-compatibleNo1 is after today and 2 is today or earlier.
whereabouts_not_setAnyNoPresence selects assets with no whereabouts.
archivedInteger-compatibleNoValues below 2 apply an exact archive filter; larger values omit it.
order[0][column] / order[0][dir]Integer / stringNoLegacy 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

ResponseCondition
{"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, or Asset. Home whereabouts is JSON containing type_id, location_id, name, and type.
  • 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