Communications
Query mapped email-template details
/a/EmailTemplate_getRequestedDetails
Query selected camelCase email-template fields without pagination.
When to use this endpoint
Use EmailTemplate_getRequestedDetails when a caller needs a mapped field subset or several templates. Use EmailTemplate_get for one complete raw row.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler requires login and performs no additional page or role-permission check.
The read or write is limited to the authenticated tenant. Notice endpoints that say “current user” use the authenticated session user ID within that tenant.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fields | Native array | No | Mapped fields to return from id, name, body, archived, fromEmail, isDefault, subject, type, meta, and metaFormID. Omission requests every mapped field; unknown names are ignored and id is always included. |
id / ids | Integer-compatible or native array | No | Optional numeric ID filter. id takes precedence over ids; scalar values and array members are integer-converted. |
name, body, fromEmail, subject, meta, metaFormID | Scalar or native array | No | Exact case-insensitive mapped filters. Arrays become exact IN filters. |
archived, isDefault, type | Scalar or native array | No | Exact integer-converted filters. |
order | Native array | No | Mapped order names or objects such as [['id' => 'name', 'dir' => 'desc']]. No order is applied when omitted. |
Example request
$templates = FM_api('EmailTemplate_getRequestedDetails', [
'fields' => ['id', 'name', 'subject', 'type', 'archived'],
'archived' => '0',
'order' => [['id' => 'name']],
]);
Example response
[{
"id": "152004",
"name": "Service completion email",
"subject": "Your service report",
"type": "1",
"archived": "0"
}]
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 rows match, an ID array has no usable IDs, or filters exclude every row. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- This endpoint has no pagination, implicit limit, or implicit ordering. Omitting filters can return every template, including archived rows.
metais returned as stored text. The nestedmetaFormIDprojection has a legacy alias-order quirk: requestmetabeforemetaFormIDto obtain the nested value. IfmetaFormIDis requested first or alone, the shared reader aliases the scalar extraction asmetaand then returnsmetaFormIDas null.- The requested
fieldsvalue must be a native array by the time the handler runs; the shared signed-request dispatcher is responsible for decoding encoded arrays.
See it in Fieldmotion
CRM1
No direct CRM1 caller was found; CRM1 uses raw detail and dedicated list endpoints.
CRM2
Open a customer’s Emails page. CRM2 requests id and name for template labels while loading email history.
Related endpoints
EmailTemplate_getreturns one complete raw row.EmailTemplate_updateDatawrites the same mapped keys.