Job types
List job types for the legacy table
/a/JobTypes_getDT
Return a filtered legacy DataTables page of job types with the positional values expected by CRM1’s settings table.
When to use this endpoint
Use JobTypes_getDT only for CRM1’s Job Types table or a client deliberately implementing its positional-row contract. CRM2 uses JobTypes_getDataTable.
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 |
|---|---|---|---|
start | Integer string | Yes | Zero-based result offset. It must integer-convert to zero or greater. |
length | Integer string | Yes | Page size after integer conversion. It must be at least 1; the handler imposes no maximum. |
order[0][column] | Integer string | Yes | 0 sorts by ID; 1 sorts by name; every other value falls back to name. |
order[0][dir] | String | Yes | Exact desc selects descending order; every other value selects ascending order. |
draw | Integer string | Yes | DataTables draw counter, returned after integer conversion. |
name | String | No | Trimmed, case-insensitive substring filter on the job-type name. Blank input applies no filter. |
Example request
$page = FM_api('JobTypes_getDT', [
'start' => '0',
'length' => '25',
'order' => [['column' => '1', 'dir' => 'asc']],
'draw' => '3',
'name' => 'repair',
]);
Example response
{
"draw": 3,
"recordsTotal": "8",
"recordsFiltered": "1",
"data": [
["42", "Emergency repair", "4", "", [2, "dispatch@example.test"], "Default notes", 60, "{\"rate\":20}", "0", "18", "", "7"]
]
}
Each row is [id, name, priority, "", [send_notification, notification_email], notes, duration, tax_settings, archived, form_id, "", department]. Missing metadata values default to 0 or an empty string; stored tax settings remain encoded text.
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: start"} | start is absent or negative. |
{"error":"missing or invalid parameter: length"} | length is absent or below 1. |
{"error":"missing or invalid parameter: [order][0][dir]"} | The nested direction is absent. |
{"error":"missing or invalid parameter: [order][0][column]"} | The nested column 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
- Both counts include archived rows; the name filter changes only
recordsFilteredand the returned page. - Invalid or non-object metadata is treated as empty metadata for the derived notification, duration, and form values.
- The endpoint accepts no general DataTables search value and has no tenant-setting-dependent columns.
See it in Fieldmotion
CRM1
Open Settings → Job Types, filter by name, sort, or change page. The table sends JobTypes_getDT; its UI offers a 500-row page size because this route has no cap.
CRM2
CRM2’s Job Types screen does not call this route; its shared configurable table derives JobTypes_getDataTable.
Related endpoints
JobTypes_getDataTablereturns named fields for CRM2.JobTypes_getByIdreads explicit IDs without table metadata.