When to use this endpoint

Use UserClockins_calendar to populate CRM2’s Clock-ins calendar badges with distinct clocked-in users and flagged-row counts.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.

The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.

Parameters

ParameterTypeRequiredDescription
fromYYYY-MM-DDYesInclusive start date. It must be a real calendar date in exact zero-padded form.
toYYYY-MM-DDYesInclusive end date. It must be a real date and not sort before from.

Example request

$days = FM_api('UserClockins_calendar', [
	'from' => '2026-09-01',
	'to' => '2026-09-30',
]);

Example response

{
  "data": [
    {"date": "2026-09-25", "user_count": 7, "flagged_count": 2},
    {"date": "2026-09-26", "user_count": 5, "flagged_count": 0}
  ]
}

Errors and unusual responses

ResponseCondition
{"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"}The start is absent, malformed, or not a real date.
{"error":"missing or invalid parameter: to"}The end is absent, malformed, or not a real date.
{"error":"invalid date range"}The valid start string sorts after the valid end string.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • user_count counts distinct positive user IDs only on rows with a positive clock-in. Multiple sessions by one user count once.
  • flagged_count counts every row whose flag equals 1, including a clock-out-only row. A date containing rows but neither condition still appears with zero counts.
  • Dates with no stored rows are omitted. There is no pagination, user/department/permission filter, or explicit range-size limit.

See it in Fieldmotion

CRM1

No direct CRM1 caller was found; CRM1 has only the list table.

CRM2

Switch Users → Clock-ins to Calendar view. The client requests the visible grid’s first and last dates.

Related endpoints