Communications
Query the CRM2 Notices table
/a/Notices_getDataTable
Page and filter the current user’s mapped notices for the CRM2 Notifications screen.
When to use this endpoint
Use Notices_getDataTable for a server-paged notice history with mapped fields, platform labels, and the CRM bell unread count. Use Notice_checkNew for the compact five-row header feed.
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 | Yes | Mapped fields selected from id, subject, body, status, userID, cDate, cDateUnix, dueDate, meta, originalID, sDate, and metaCreatedBy. Unknown names are ignored, id is always added, and derived platform is always returned. |
isTable | Integer-compatible | No | Defaults to table mode. Exact integer 0 returns only data plus notifCount and enables optional limit. |
draw, start, length | Integer-compatible | No | Table counter, offset, and page size; defaults are 0, 0, and 10. |
limit | Integer-compatible | No | Positive limit used only outside table mode. Zero means unbounded. |
orderBy / orderDesc | Mapped field / direction | No | Explicit mapped ordering. CRM2 sends cDate and desc. Unknown order fields fall back to a requested mapped field. |
order[0][column] / order[0][dir] | Integer / string | No | DataTables ordering fallback when explicit ordering is absent. |
searchValue / searchField | String / mapped field or array | No | Case-insensitive substring search over the selected mapped fields; default search field is All. |
id, status, cDate, cDateUnix, dueDate, originalID, sDate | Scalar or native array | No | Exact numeric mapped filters. The endpoint always adds userID for the current user and ignores a caller-supplied different user. |
subject, body, meta | Scalar or native array | No | Text/JSON filters. A scalar uses case-insensitive substring matching; an array uses exact IN matching. |
metaCreatedBy | String or native array | No | Creator metadata filter. Exact lowercase fieldmotion is a special token matching null, blank, or zero creator metadata; other scalar values use substring matching. |
referenceDate, dateFrom, dateTo | Mapped field and integer day offsets | No | Tenant-timezone relative-day range. Both offsets are required; CRM2 uses referenceDate=cDate. These are offsets from today, not date strings. |
timeRangeFrom, timeRangeTo, offsetFrom, offsetTo | Hour integers / native objects | No | Optional shared time-of-day range and hour/minute offsets applied when a valid referenceDate is present. |
advanceSearch, groupBy | Native arrays | No | Shared mapped-table advanced filters and grouping controls. |
Example request
$table = FM_api('Notices_getDataTable', [
'fields' => ['id', 'subject', 'status', 'cDate', 'cDateUnix', 'meta'],
'draw' => '2',
'start' => '0',
'length' => '10',
'orderBy' => 'cDate',
'orderDesc' => 'desc',
]);
Example response
{
"data": [{
"id": "49018",
"subject": "Mentioned you in Job 1842",
"status": "0",
"cDate": "2026-10-01 09:30:00",
"cDateUnix": "1790847000",
"meta": "{\"createdBy\":19,\"link\":\"#pageJob&id=1842\"}",
"platform": "CRM"
}],
"draw": 2,
"recordsTotal": "240",
"recordsFiltered": "18",
"notifCount": "3"
}
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 is absent. |
{"error":"error in database query"} | A generated selection, filter, grouping, or ordering query fails. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Unlike the header bell, table data includes rows whose metadata has
source="push". DerivedplatformisAppfor those rows andCRMotherwise; the unreadnotifCountstill excludes app-push rows. cDateformats the Unix timestamp as a database datetime string whilecDateUnixreturns the raw timestamp. Request both when the UI needs display and relative-time calculations.- Table mode returns data, integer draw, and database scalar counts. Non-table mode omits draw and record counts but still appends
notifCount. - There is no deleted-state filter because notices are hard-deleted rather than soft-deleted.
See it in Fieldmotion
CRM1
No direct CRM1 caller was found; CRM1 uses the unpaged Notices_list widget feed.
CRM2
Open Notifications, scroll, sort, or apply date/creator/status filters. The page requests 10 rows at a time and collects returned IDs for bulk deletion.
Related endpoints
Notice_deleteDatadeletes displayed or all current-user rows.Notice_checkNewsupplies the CRM-only header summary.