Job types
Retrieve selected job-type fields
/a/JobType_getRequestedDetails
Retrieve selected named fields for one, several, or all job types through CRM2’s field map.
When to use this endpoint
Use JobType_getRequestedDetails for CRM2 configurable details or a mapped lookup that does not need table counts.
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 | No | Any of id, name, priority, lastEdited, notes, meta, archived, nominalCode, taxSettings, department, metaFormID, metaSendNotification, metaNotificationEmail, and metaOrderNum. Omission requests all fields; unknown names are ignored; id is always added. |
id / ids | Integer string or native array | No | Optional ID restriction; id takes precedence. Scalars and items are integer-converted. JSON array text is not decoded. |
Mapped field filters | Scalar or native array | No | Supply any mapped field key. Text values use case-insensitive exact matching, numeric values use integer equality, and arrays become IN lists. Metadata subfields filter their decoded JSON paths. |
order | Field name or native list | No | Mapped ordering. List members may be names or objects such as {"id":"metaOrderNum","dir":"desc"}; exact desc reverses that key. |
advanceSearch | Native array | No | Shared CRM2 advanced conditions over mapped fields. |
Example request
$types = FM_api('JobType_getRequestedDetails', [
'ids' => ['42', '43'],
'fields' => ['id', 'name', 'priority', 'metaFormID'],
'order' => [['id' => 'name', 'dir' => 'asc']],
]);
Example response
[
{"id": "42", "name": "Emergency repair", "priority": "4", "metaFormID": "18"},
{"id": "43", "name": "Inspection", "priority": "2", "metaFormID": "21"}
]
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 the IDs or filters. Missing IDs are omitted. |
Runtime warning or type error | fields, order, an ID list, or advanceSearch is supplied in 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
- No default ordering is applied. Job types have no soft-delete filter.
metaremains raw stored text, while namedmeta*fields are extracted from it.taxSettingsremains encoded JSON text.- Legacy advanced-search objects containing raw
whereexpressions are trusted internal CRM input and should not be constructed by third parties.
See it in Fieldmotion
CRM1
A production-source search found no direct CRM1 caller.
CRM2
Open Settings → Job Types to see mapped detail/tax-settings requests. CRM2 also requests ID/name pairs while rendering Job Details and loads all ID/name pairs to resolve entries in job history.
Related endpoints
JobType_updateDataupdates these mapped keys.JobType_updateFieldreplaces one mapped key across explicit IDs.