When to use this endpoint

Use AssetTypes_getDataTable for CRM2’s Asset Types list and its first export-selection pass. It returns map names rather than CRM1’s positional rows.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.

The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.

Parameters

ParameterTypeRequiredDescription
fieldsArrayYesNative array of mapped fields: id, name, meta, lastEdited, attrs, rentalTypeID, and/or metaURL. Unknown values are ignored and id is always added.
isTableInteger stringNoDefaults to table mode. Exact integer 0 returns only data and permits optional limit.
draw / start / lengthInteger stringsNoTable counter, offset, and page size; defaults are 0, 0, and 10. The shared engine does not reject zero/negative lengths before SQL.
limitInteger stringNoPositive limit used only in non-table mode; zero means no limit.
orderBy / orderDescField name / directionNoNamed ordering pair. Field lookup falls back case-insensitively, then to a requested map field. CRM sends asc or desc.
order[0][column] / order[0][dir]DataTables valuesNoFallback table ordering. The engine subtracts one from the column index for its leading action-column convention; exact desc reverses the result.
searchValue / searchFieldString / string or arrayNoCase-insensitive substring search across one or more mapped fields; omission of searchField means all mapped fields.
Mapped field filtersScalar or arrayNoAny mapped key can filter rows. Text scalars use case-insensitive substring matching, integers use equality, and arrays use IN.
referenceDate / dateFrom / dateTo / offsetsShared date-filter valuesNoRelative date filtering is available when referenceDate=lastEdited. Day offsets are inclusive and based on today in the tenant timezone.
advanceSearch / groupByArraysNoShared CRM2 advanced conditions and mapped grouping. Invalid field names are ignored.

Example request

$table = FM_api('AssetTypes_getDataTable', [
	'fields' => ['id', 'name', 'attrs', 'metaURL'],
	'draw' => '3',
	'start' => '0',
	'length' => '25',
	'searchField' => 'name',
	'searchValue' => 'compressor',
	'orderBy' => 'name',
	'orderDesc' => 'asc',
]);

Example response

{
  "data": [
    {"id": "47", "name": "Compressor", "attrs": "2", "metaURL": "https://example.test/assets", "hasFiles": 1}
  ],
  "draw": 3,
  "recordsTotal": "12",
  "recordsFiltered": "1"
}

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: fields"}fields is absent.
{"error":"error in database query"}The mapped/filter query fails.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • Table mode returns paged data plus integer draw and database scalar counts. Non-table mode omits counts and is unlimited unless limit is positive.
  • recordsTotal counts all tenant types; recordsFiltered includes mapped, search, date, grouping, and advanced filters.
  • Every returned row receives hasFiles even when it was not requested. It is calculated with an additional count query for file type enum 1.
  • meta remains a JSON string; metaURL is the extracted URL or null. No type status filter exists.

See it in Fieldmotion

CRM1

No production CRM1 caller was found; CRM1 uses AssetTypes_getDT.

CRM2

Open Asset Types, change columns/search/filter/page, or start an export and inspect AssetTypes_getDataTable. Export uses non-table mode to collect matching IDs.

Related endpoints