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

ParameterTypeRequiredDescription
drawInteger stringYesDataTables draw counter, returned as an integer. Presence is required, including when the value is zero.
startInteger stringNoZero-based offset. Defaults to 0; negative input also falls back to zero.
lengthInteger stringYesPage size. Must integer-convert to at least 1.
order[0][dir]StringYesExact asc means ascending; every other present value means descending when a sortable column is selected.
order[0][column]Integer stringNo0 sorts by ID and 1 by name. Other/missing values leave database order unspecified.
search[value]StringNoCase-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

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: 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

  • recordsTotal counts every tenant asset type; recordsFiltered applies only the optional search.
  • hasFiles performs a file-count query for each returned row using file type enum 1. hasLegacyTemplate only tests whether parsed metadata contains template; 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