Forms
Find a form block by name
/a/FormBlock_getByName
Resolve one reusable block by its exact stored name and return the complete raw row.
When to use this endpoint
Use this while resolving a named block embedded in an email template or report document. Use the ID lookup when the caller already has a stable block ID.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session and is scoped to the authenticated tenant.
The handler performs no form, department, owner, or page-permission check unless the page below says otherwise. CRM navigation may impose additional UI-only access rules.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Trimmed exact block name. Blank and whitespace-only values are rejected; matching follows the tenant database collation. |
Example request
$block = FM_api('FormBlock_getByName', [
'name' => 'Standard footer',
]);
Example response
{
"id": "4822",
"type": "1",
"name": "Standard footer",
"image": null,
"code": "<footer>...</footer>",
"parent": "0",
"cdate": "1790841600",
"last_edited": "1790845200"
}
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 or missing parameter: name"} | The name is absent or blank after trimming. |
{"error":"no such form block"} | No block matches the exact name. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- The response is an untransformed row with
id,type,name,image,code,parent,cdate, andlast_edited. - The query has no type filter or explicit ordering. Names are intended to be tenant-wide unique, but legacy duplicates make the selected row database-dependent.
See it in Fieldmotion
CRM1
Email-template and report-document editors call this endpoint when expanding a saved named block.
CRM2
Notification-email, email-template, and report-document editors use the same named lookup.
Related endpoints
FormBlock_getretrieves a known ID.FormBlocks_listlists names and IDs by block type.