Form definitions, recorded responses and exports
Read mapped form details
/a/Form_getRequestedDetails
Read selected form definitions using CRM2 field aliases and optional catalogue filters.
When to use this endpoint
Use for Form pickers or a known selection of definitions. For recorded Job answers use the response grid/export routes, not this definition reader.
Authentication and permissions
Authenticate with a signed API key (acting as its owner) or a logged-in CRM session on the routed account host. Session calls include the dispatcher’s CSRF value when configured. IDs refer to the authenticated tenant unless an explicit cross-account copy is described.
The handler adds no Forms page/role check. The dispatcher does not add a Form record-scope predicate; a screen’s CRM2 role controls are not evidence of an API restriction or a CRM1 permission requirement.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id / ids | Scalar ID or native array | No | id takes precedence. Scalars are integer-converted; arrays are integer-converted element-by-element. Omitted selection reads all matching forms. An empty native array adds no ID filter and can therefore return every form. |
fields | Native array of mapped names | No | Omitted returns all mapped names. Unknown names are ignored; id is always added. A JSON string is not decoded by this helper. |
Mapped field filters | Scalar or native array | No | Any mapped alias below can be an exact filter. Text matches are trimmed, case-insensitive equality; arrays mean IN. Numeric filters are integer-converted; filters combine with AND. |
order | Native array | No | Mapped field names or objects such as {id:"name",dir:"asc"}. Only exact desc selects descending; no default order. |
jobCreate | Truthy flag | No | Apply CRM Job Form preferences for the creator’s role. Without it, no creation-choice filter is applied. |
jobFormUserID | Nonnegative decimal ID | No | With jobCreate, intersect creator-role choices with the selected assignee’s effective preferences. Default 0 adds no assignee. Invalid values fail closed to an empty selection. |
Example request
$forms = FM_api('Form_getRequestedDetails', [
'ids'=>['1042','1043'],
'fields'=>['id','name','type','fieldsData','theme'],
'archived'=>'0','order'=>[['id'=>'name','dir'=>'asc']],
]);
Example response
[{"id":"1042","name":"Inspection","type":"0","fieldsData":"[]","theme":"fm"}]
Database numeric values can be JSON strings. Examples are representative; legacy application errors can use HTTP 200, so inspect the decoded response.
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":"invalid advanced search"} | Raw advanced-search input is not accepted. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Available names:
idandname, fieldsData, template, ownerID, lastEdited, onComplete, autodocs, type, archived, replyTo, reportType, portalVisibility, usesStock, isInvoiceable, autodocsDoc, theme, meta, emailTemplateID, departmentID, selectByDefault, cdate, phpdocxVersion, metaTags, metaNotes. Stored JSON columns such as fieldsData, onComplete and meta remain encoded strings; metadata aliases theme/metaTags/metaNotes extract their saved path values. - There is no forced type or archived filter, no pagination/limit and no default order. Pass type=0 and archived=0 explicitly when listing active Job Forms. start/length are not DataTables controls here.
- Missing selected rows are omitted rather than returned as placeholders; no match is []. Empty fields returns id only. Empty ids does not mean an empty result.
- jobCreate reads crm-job-forms-role-<role> and, for a selected user, crm-job-forms-user-<user> preferences, with user defaults inherited from their role. A selected-mode preference with an empty ids list means no choices; unset/all modes remain unrestricted. The helper does not itself add type=0 or archived=0.
- Raw advanced-search input is rejected with invalid advanced search. The standard mapped advanced-search controls use the shared reader; do not supply arbitrary SQL.
Side effects
- Reads only; no definition, preferences or Job answers are changed.
- Mobile callers were checked separately: the app receives form definitions through the m service syncDownloads/syncDownloadOne forms paths. No direct app caller for these definition-management routes was found; CRM picker preferences are not a promise about mobile form availability.
See it in Fieldmotion
CRM1
No direct CRM1 caller found; legacy Form_get/Forms catalogue readers serve the editor.
CRM2
Forms list metadata, list pickers, Job creation and AutoDoc source pickers use Form_getRequestedDetails through getRequestedDetails/list helpers. Job creation sends jobCreate and jobFormUserID; watch them when diagnosing missing choices.
Related endpoints
Form_updateData— patch returned aliases.Form_dataGetDT— read recorded responses instead of definitions.