Notification rules
Browse notification rules
/a/NotificationTypes_getDataTable
Filter and page the rule catalogue used by notification editors.
When to use this endpoint
Request explicit fields and format=0 or 3 for the desired Email/Push view.
Authentication and permissions
Use signed API-key authentication or a logged-in CRM session on the account’s routed host. API keys act as their owner; normal session requests need dispatcher CSRF protection where configured. Tenant data is selected from the authenticated account.
The handler has no additional page-action/Role check. A CRM2 screen hiding a control does not add such a server guard, and CRM2 role names must not be assumed to apply to CRM1. The dispatcher has no dedicated object-scope mapping for this namespace.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupBy | Native list of mapped names | No | Groups the SQL rows by recognized mapped fields. Returned columns remain ordinary projections; counts still count matching records rather than groups. This wrapper adds no aggregate-safe projection validator. |
fields | Native list of mapped names | No for details; required for tables | Details default to all mapped fields. Unknown names are omitted; id is always included. JSON-encoded list text is not decoded. Whole JSON/text columns remain encoded strings, while nested metadata projections can decode values. |
start / length / draw / isTable / limit | Integer-compatible | No | Table defaults 0/10/0 for offset/page size/draw. isTable integer-converting to 0 returns {data:[...]} without draw/counts, optionally capped by positive limit. No route-owned maximum, negative-value clamp or length=-1 all-record sentinel exists. |
orderBy / orderDesc / order | Mapped name/direction or DataTables order | No | Named orderBy/orderDesc take precedence; use asc/desc. Otherwise order[0].column minus one (clamped at zero) selects a projected mapped field; default first recognized projected field ascending. No stable ID tie-breaker. Unpaged mode has separate reference-date ordering. |
searchValue / searchField | Text / mapped name or native list | No | Case-insensitive substring LIKE; searchField defaults All. SQL % and _ retain wildcard meaning. |
referenceDate / dateFrom / dateTo | Mapped date field / relative integer day offsets | No | Both bounds add inclusive day limits relative to today in the account timezone, with UTC fallback. These are day offsets, not absolute dates. Legacy offsetFrom/offsetTo hour/minute objects adjust datetime boundaries; date-only fields ignore them. timeRangeFrom enables inclusive hour filtering, upper timeRangeTo defaults 23; reversed bounds swap and the hour timezone falls back to Europe/London. |
Mapped filters / order / advanceSearch | Scalars, native lists or structured query controls | No | Mapped filters combine with AND; lists use IN. Detail text filters are trimmed case-insensitive exact matches; table text filters use substring LIKE. Detail order accepts mapped names or {id,dir} descriptors. Structured comparisons use mapped columns, condition/value and optional andOr/special. These legacy wrappers do not add a strict query-control allowlist; raw advanced conditions are a trusted UI surface, not an integration SQL interface. |
Rule filters | Mapped values | No | name, subject, body, recipient (JSON), replyTo, tableName, status, type, format, meta (JSON), cdate and lastEdited. name/replyTo/tableName have storage varchar(100) limits, without equivalent route-owned length checks. id is also in the low-level map. There is no automatic enabled/channel/actor filter. |
Example request
$result = FM_api('NotificationTypes_getDataTable', ['fields'=>['id','name','tableName','type','status','format','meta'],'format'=>'0','start'=>'0','length'=>'10']);
Example response
{
"data": [],
"draw": 0,
"recordsTotal": "0",
"recordsFiltered": "0"
}
Application errors normally remain JSON responses with HTTP 200; inspect error/warning keys. Numeric driver values can be strings.
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":"missing or invalid parameter: fields"} | fields omitted. |
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 handler itself does not call the login guard, but mapped reads require a valid tenant context; use the normal authenticated API. There is no dedicated role/TeamAccess object check here.
- Whole recipient/meta columns remain encoded JSON; counts cover all tenant rules and filtered matches. No soft-delete flag is present in this catalogue map; no implicit archive/deleted/active filter. Unpaged mode remains a data envelope.
Side effects
- Database read only; no worker run, schedule recomputation or send.
See it in Fieldmotion
CRM1
Settings > Notifications Email/Push uses mapped notificationType requests; Push requires the UI pushNotifications feature. UI-required names/subjects are stronger than the generic server map.
CRM2
Settings > Notifications, Email/Push: create/edit, inline status, Copy and Delete use the shared notificationType module and these routes. Inspect the request’s tableName/type/format and encoded recipient/meta.
Related endpoints
NotificationType_createData— Continue the related read/write workflow.NotificationType_updateData— Continue the related read/write workflow.NotificationType_copy— Continue the related read/write workflow.