Asset types
Query mapped asset types
/a/AssetTypes_getDataTable
Query asset types through CRM2’s selectable named-field table engine.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
fields | Array | Yes | Native array of mapped fields: id, name, meta, lastEdited, attrs, rentalTypeID, and/or metaURL. Unknown values are ignored and id is always added. |
isTable | Integer string | No | Defaults to table mode. Exact integer 0 returns only data and permits optional limit. |
draw / start / length | Integer strings | No | Table counter, offset, and page size; defaults are 0, 0, and 10. The shared engine does not reject zero/negative lengths before SQL. |
limit | Integer string | No | Positive limit used only in non-table mode; zero means no limit. |
orderBy / orderDesc | Field name / direction | No | Named 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 values | No | Fallback table ordering. The engine subtracts one from the column index for its leading action-column convention; exact desc reverses the result. |
searchValue / searchField | String / string or array | No | Case-insensitive substring search across one or more mapped fields; omission of searchField means all mapped fields. |
Mapped field filters | Scalar or array | No | Any mapped key can filter rows. Text scalars use case-insensitive substring matching, integers use equality, and arrays use IN. |
referenceDate / dateFrom / dateTo / offsets | Shared date-filter values | No | Relative date filtering is available when referenceDate=lastEdited. Day offsets are inclusive and based on today in the tenant timezone. |
advanceSearch / groupBy | Arrays | No | Shared 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
| 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: 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
drawand database scalar counts. Non-table mode omits counts and is unlimited unlesslimitis positive. recordsTotalcounts all tenant types;recordsFilteredincludes mapped, search, date, grouping, and advanced filters.- Every returned row receives
hasFileseven when it was not requested. It is calculated with an additional count query for file type enum1. metaremains a JSON string;metaURLis 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
AssetTypes_getExportDatafetches the selected fields for those IDs.AssetType_getRequestedDetailsprovides unpaged exact-detail filtering.