Skills
Query skills through the field map
/a/Skills_getDataTable
Query skills through CRM2’s named field map with shared filters, search, ordering, grouping, and pagination.
When to use this endpoint
Use Skills_getDataTable for CRM2’s configurable Skills list or another named-field query. It does not include assignment counts; load user-skill records separately when needed.
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 | Native array | Yes | Requested keys from id, name, cdate, lastEdited, and description. Unknown keys are ignored and id is always returned. |
isTable | Integer string | No | Defaults to table mode. Exact integer 0 returns only data and enables the optional non-table limit. |
draw / start / length | Integer strings | No | Table counter, offset, and page size; defaults are 0, 0, and 10. There is no endpoint-specific maximum. |
limit | Integer string | No | Positive non-table maximum. Zero or a negative value leaves the result unlimited. |
orderBy / orderDesc | Mapped name / direction | No | Explicit ordering. Field resolution is case-insensitive before falling back; orderDesc is not normalized. |
order[0][column] / order[0][dir] | DataTables values | No | Fallback table ordering. The helper subtracts one for CRM2’s leading action column; exact desc reverses the result. |
searchValue / searchField | String / mapped name or native array | No | Case-insensitive substring search over selected/all mapped fields. |
Mapped field filters | Scalar or native array | No | Text/datetime scalars use case-insensitive substring filters, integer scalars equality, and arrays IN. |
referenceDate / dateFrom / dateTo / offsets | Shared date-filter values | No | Inclusive relative-date filtering is technically available for mapped fields, but the skill timestamp map does not match the integer schema; avoid this feature here. |
advanceSearch / groupBy | Native arrays | No | CRM2 advanced conditions and mapped grouping. Unknown map fields are ignored. |
Example request
$page = FM_api('Skills_getDataTable', [
'fields' => ['id', 'name', 'description'],
'searchValue' => 'electrical',
'start' => '0',
'length' => '25',
'draw' => '5',
]);
Example response
{
"data": [
{"id": "42", "name": "Electrical testing", "description": "Qualified tester"}
],
"draw": 5,
"recordsTotal": "6",
"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 generated mapped/filter query fails. |
Runtime warning or type error | fields or another shared array option has an unsupported scalar shape. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- All skills are eligible because the table has no archive or delete state. There is no implicit assignment/user filter.
- Table mode returns paging metadata and database scalar counts. Non-table mode returns only
dataand is unlimited unlesslimitis positive. - This route returns skill columns only; CRM2 computes displayed user counts from a separate complete user-skill list.
See it in Fieldmotion
CRM1
CRM1 uses Skills_getDT and does not directly call this route.
CRM2
Open Users → Skills. The shared display widget derives Skills_getDataTable from the plural API prefix and sends visible/configured mapped fields.
Related endpoints
Skills_getDTincludes the legacy per-page assignment counts.Skill_getRequestedDetailsreads mapped details without table counts.