Task types
Retrieve selected task-type fields
/a/TaskType_getRequestedDetails
Retrieve mapped task-type rows with caller-selected fields, exact filters, and optional ordering.
When to use this endpoint
Use TaskType_getRequestedDetails for CRM2 pickers and layouts that need named task-type fields without table paging metadata.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler calls the normal login guard but performs no additional Settings-page, role, create, edit, or delete permission check.
All reads and writes use the authenticated tenant. CRM1 and CRM2 decide whether to show task-type controls, but these handlers do not repeat those client-side checks.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fields | Native array | No | Mapped response names. Defaults to all four map keys: id, name, cDate, and lastEdited. Unknown names are ignored; id is always included. |
id / ids | Integer-compatible or native array | No | Exact ID filter. Scalar values become a one-item list; array members are integer-converted. If both exist, id wins. |
name | String or native array | No | Case-insensitive exact name match, or exact IN list after lowercasing/trimming. This is not substring search. |
cDate / lastEdited | String or native array | No | Case-insensitive exact stored datetime filter(s). The helper does not validate datetime format here. |
order | String, object, or native array | No | Mapped ordering. A field-name string sorts ascending; an object such as {"id":"name","dir":"desc"} selects direction. Unknown fields are ignored. |
advanceSearch | Native array | No | Shared mapped condition objects, when needed by CRM2 widgets. |
Example request
$types = FM_api('TaskType_getRequestedDetails', [
'fields' => ['id', 'name'],
'order' => [['id' => 'name', 'dir' => 'asc']],
]);
Example response
[
{"id": "3", "name": "Customer follow-up"},
{"id": "7", "name": "Internal review"}
]
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. |
[] | No row matches. Unknown requested fields are skipped rather than rejected. |
Runtime/type error | fields is supplied as a JSON string instead of the required native array. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- There is no pagination or limit. Without
order, database order is unspecified. - Task types have no active/deleted flag, so every stored row is eligible.
- Database-backed scalars remain JSON strings and response keys use mapped names.
See it in Fieldmotion
CRM1
No direct CRM1 caller was found. CRM1 uses TaskTypes_list or TaskTypes_getById.
CRM2
The Task Calendar and Task Kanban screens call this route for id/name picker data. The shared Task Types widget also derives it as its mapped read route.
Related endpoints
TaskTypes_getDataTableadds paging, searching, and count metadata.TaskTypes_listprovides the simpler always-name-sorted ID/name list.