Form definitions, recorded responses and exports
List Contract checklist AutoDoc tokens
/a/Form_contractChecklistFields
List named Contract checklist question and answer placeholders for a Job Form AutoDoc.
When to use this endpoint
Use to populate the AutoDoc field picker. These are catalogue tokens; they are not the answers for a particular Contract or Job.
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.
Requires Forms View (pageForms_view) with no legacy role-less allowance. Client administrators pass. The handler uses an explicitly routed tenant connection; the check is not conditional on the CRM version.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Positive decimal integer or digit string | Yes | Job Form ID. Arrays, zero, signs and malformed IDs are rejected before the login check. |
Example request
$result = FM_api('Form_contractChecklistFields', ['id'=>'1042']);
Example response
{"ok":1,"fields":[{"id":"ccq_12_q1","name":"Site checks · Access safe? — Question","question":"Access safe?","part":"Question","template_name":"Site checks"},{"id":"cca_12_q1","name":"Site checks · Access safe? — Answer","question":"Access safe?","part":"Answer","template_name":"Site checks"}]}
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":"Choose a Job Form"} | Missing/invalid ID. |
{"error":"Permission denied"} | Missing Forms View; response can also include reason. |
{"error":"Contract checklist mappings are available for Job Forms"} | Enabled feature, but form missing or not type 0. |
{"error":"Unable to load Contract checklist mappings. Please retry."} | Invalid or unreadable catalogue. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Requires account feature contractProgrammes. When disabled, returns ok with an empty fields list before checking whether the form exists or is type 0.
- With the feature enabled, the form must exist and have type 0; archived forms are not excluded. Reads the latest saved named checklist catalogue and excludes templates marked deleted. It does not restrict the list to a Contract’s selected template or a sector.
- Each question yields two entries in saved template/question order: ccq_<templateID>_<questionID> for question text and cca_<templateID>_<questionID> for the answer. IDs are stable tokens, not field indexes; part is Question or Answer. No pagination.
- Invalid catalogue structures or unsafe identities return a controlled error rather than a partial mapping list.
Side effects
- Reads only; no checklist assignment, question answer or published Job snapshot is changed.
See it in Fieldmotion
CRM1
No direct CRM1 caller found for the checklist mapping catalogue.
CRM2
Open a Job Form’s AutoDoc editor with Programme Contracts enabled. Its Contract checklists field-picker source calls Form_contractChecklistFields with the form ID; inspect Network for that route.
Related endpoints
Form_getRequestedDetails— read the form’s type and AutoDoc definition.Form_updateData— save the AutoDoc using selected tokens.