When to use this endpoint

Use AssetMaintenance_getDT for the legacy Assets → Maintenance DataTable. Its positional rows are tailored to that screen rather than a general integration shape.

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 stringNoDataTables request counter, echoed as an integer. Missing becomes 0.
startInteger stringNoZero-based row offset; defaults to 0.
lengthInteger stringNoPage size; defaults to 10. Invalid/negative values are not rejected before SQL.
daysFrom / daysToInteger stringsNoDay offsets from current server datetime; both default to 0. CRM1 defaults to -7 and 7. The predicate selects schedules spanning the lower boundary or created inside the range.
search[value]StringNoSubstring search across asset name/code, IDs, owner, description, next date, and recurrence dates. DataTables’ regex flag is ignored.
activeInteger stringNoExact recurrence active-state filter. Presence with blank value selects inactive rows; omission includes both states.
order[0][column] / order[0][dir]DataTables valuesNoColumns 0–7 map to maintenance ID, asset ID, owner, description, next date, recurrence creation date, expiry date, and frequency amount. Exact asc ascends; every other direction descends.

Example request

$table = FM_api('AssetMaintenance_getDT', [
	'draw' => '4',
	'start' => '0',
	'length' => '25',
	'daysFrom' => '-7',
	'daysTo' => '7',
	'active' => '1',
	'search' => ['value' => 'filter', 'regex' => 'false'],
	'order' => [['column' => '4', 'dir' => 'asc']],
]);

Example response

{
  "draw": 4,
  "recordsTotal": "12",
  "recordsFiltered": "1",
  "data": [
    [
      "61003",
      "418",
      "Filter service",
      ["2026-10-15 09:00:00", "2039001", "27"],
      "2026-09-24",
      ["879027", null],
      ["5", "3"],
      ["1042", "Acme Services"],
      "27",
      "1",
      "879027"
    ]
  ]
}

Rows are positional: maintenance ID, asset ID, description, [nextDate,nextJobID,nextJobUserID], recurrence created date, [recurrenceID,expiryDate], [unit,amount], [ownerID,ownerName], default user ID, active state, and recurrence ID again.

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.

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

Behaviour and edge cases

  • The route and production caller use AssetMaintenance_getDT, while the PHP function is declared AssetMaintenance_GetDT. PHP’s case-insensitive function lookup preserves this legacy casing mismatch.
  • recordsTotal counts every maintenance row, while returned/filtered rows exclude soft-deleted or missing assets and apply date/status/search filters.
  • The repair runs only for null next dates, uses the recurrence’s unnormalized legacy ID list, and does not repair stale non-null values.
  • There is no default ordering when order is absent. Equal sort values have no tie-breaker.

Side effects

  • Possible repair updates to maintenance linkage fields are written without an activity audit or cache invalidation. Ordinary reads make no changes.

See it in Fieldmotion

CRM1

Open Assets → Maintenance, then filter, search, sort, or page the grid while inspecting AssetMaintenance_getDT.

CRM2

No production CRM2 caller was found. CRM2’s Maintenance page delegates to the generic recurrence module and JobRecurrences_getDataTable.

Related endpoints