User accounts and profiles
Read one day of user activity counts
/a/Users_getActivityLog
Aggregate activity into minute buckets within a 24-hour interval.
When to use this endpoint
Use after selecting a day in the User Activity graph. Counts are recorded num_entries totals, not individual actions or a detailed audit trail.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. Session requests use the dispatcher’s CSRF protection when configured.
Configured TeamAccess row scope is applied in the queries. Ordinary collection requests do not need artificial record IDs. Explicit IDs still pass dispatcher record authorization; unavailable IDs can be rejected there rather than silently omitted.
Explicit Users Activity View is required.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from | Unix seconds string | Yes | Required nonnegative integer Unix timestamp; upper bound leaves room for a complete 86400-second interval. |
user_id | Integer string | No | Nonnegative integer user ID; zero or omitted means all visible users. |
activity_type | Integer string | No | Integer 0 (all), 1 (read), or 2 (write). |
session_id | String | No | Scalar session identifier, at most 4096 bytes; blank does not filter. |
Example request
$result = FM_api('Users_getActivityLog', [
'from'=>'1793664000',
'user_id'=>'1042',
]);
Example response
{
"logs": [
{
"d": "1793664060",
"n": "3"
}
],
"sessions": [
"example-session"
]
}
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: from"} | from omitted/default -1 or converts below zero. |
{"error":"invalid parameter: example"} | A supplied native control is malformed; the response names that control. Lists must be flat, and numeric IDs must be positive integers unless the parameter explicitly permits zero. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Groups by floor(timestamp/60)*60. d is the bucket’s epoch start, n is SUM(num_entries), with database numeric-string types. No missing/zero buckets are filled and no ORDER BY is specified.
- Both logs and sessions apply the same date, user/type and session filters. sessions is a distinct list, not a map of counts.
- Applies user row scope without an active/temporary-user restriction. No pagination. The interval is exactly 86400 seconds, so it does not follow variable-length local DST calendar days.
Side effects
- Reads data without changing business records, edit markers, activity history or notifications. Shared setting reads can populate their normal settings cache.
See it in Fieldmotion
CRM1
Open Users Activity in CRM1 and click a daily bar. Filter the Users_getActivityLog request with from/user_id/activity_type/session_id.
CRM2
In CRM2 Users Activity, click a day. The page calls Users_getActivityLog but does not forward a selected session_id in the inspected caller.
Related endpoints
Users_getActivityLogDaily— Read the daily graph and available session choices.Users_list— Read the basic selectable user list and its explicit scope predicate.