Asset types
List legacy asset types for a data table
/a/AssetTypes_getDT
Serve CRM1’s paginated Asset Types setup table as positional rows.
When to use this endpoint
Use AssetTypes_getDT when reproducing CRM1’s Asset Types table, including its name/ID search and file/template indicators.
CRM2 uses the named-field AssetTypes_getDataTable contract.
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 |
|---|---|---|---|
draw | Integer string | Yes | DataTables draw counter, returned as an integer. Presence is required, including when the value is zero. |
start | Integer string | No | Zero-based offset. Defaults to 0; negative input also falls back to zero. |
length | Integer string | Yes | Page size. Must integer-convert to at least 1. |
order[0][dir] | String | Yes | Exact asc means ascending; every other present value means descending when a sortable column is selected. |
order[0][column] | Integer string | No | 0 sorts by ID and 1 by name. Other/missing values leave database order unspecified. |
search[value] | String | No | Case-insensitive name substring. The same text is integer-converted and OR-matched to ID, so nonnumeric text also tests ID 0. |
Example request
$table = FM_api('AssetTypes_getDT', [
'draw' => '3',
'start' => '0',
'length' => '25',
'order' => [['column' => '1', 'dir' => 'asc']],
'search' => ['value' => 'compressor'],
]);
Example response
{
"draw": 3,
"recordsTotal": "12",
"recordsFiltered": "2",
"data": [
["47", "Compressor", 2, "https://example.test/assets", 1, 1, ""]
]
}
Each row is [id, name, vehicleMask, url, hasFiles, hasLegacyTemplate, actionPlaceholder]. vehicleMask is attrs & 2, so it is numeric 0 or 2.
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: length"} | length is absent or less than one after integer conversion. |
{"error":"missing or invalid parameter: [order][0][dir]"} | The nested direction is absent. |
{"error":"missing or invalid parameter: draw"} | draw is absent. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
recordsTotalcounts every tenant asset type;recordsFilteredapplies only the optional search.hasFilesperforms a file-count query for each returned row using file type enum1.hasLegacyTemplateonly tests whether parsed metadata containstemplate; it does not inspect CRM2 layouts.- Invalid metadata produces blank URL and no legacy-template flag. Pagination applies after search and ordering.
See it in Fieldmotion
CRM1
Open Assets → Setup Asset Types, type in the table search box or change page/sort, and inspect AssetTypes_getDT.
CRM2
No production CRM2 caller was found; CRM2 uses AssetTypes_getDataTable.
Related endpoints
AssetTypes_exportdownloads the legacy fixed-column list.AssetTypes_getDataTablereturns named CRM2 fields.