Power BI
Export Power BI user clock-in data
/a/PowerBI_getUserClockinsData
Export raw user clock-in rows whose work date falls within an inclusive date window.
When to use this endpoint
Use PowerBI_getUserClockinsData for the User Clockins table in the legacy connector.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session so that the tenant database and user context are available. The handler performs no page or role-permission check.
This direct dataset route does not consume the unsigned api_id/api_key pair used by the Power BI connector. Use PowerBI_getData for the self-authenticating connector feed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from | String | Yes | An exact lower-bound fragment such as >="2026-09-01". It is not a plain date. |
to | String | Yes | An exact upper-bound fragment such as <="2026-09-30 23:59:59". It is not a plain date. |
Example request
FM_api('PowerBI_getUserClockinsData', [
'from' => '>="2026-09-01"',
'to' => '<="2026-09-30 23:59:59"',
]);
Example response
[
{"id":"91","user_id":"18","date":"2026-09-03","clockin":"28800","clockin_cdate":"1788422400","clockin_diff":"0","clockin_notes":"","clockout":"61200","clockout_cdate":"1788454800","clockout_diff":"0","clockout_notes":"","duration":"32400","flagged":"0","notes":"[]","clockin_geo":"{}","clockin_geo_dist":null,"clockout_geo":"{}","clockout_geo_dist":null,"meta":"{}","user_signed_off":"0","source_type":"0","breaks":"[]"}
]
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":"invalid parameter: from (<value>)"} | from is absent or malformed; this endpoint includes the supplied value in the error text. |
{"error":"invalid parameter: to"} | to is absent or malformed. |
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 fragments are compared against the row’s
datecolumn, not the clock-in/out creation epochs. Rows are ordered by work date descending and then clock-in creation time descending. - The response is
SELECT *: it exposes every current table column, including timing/difference fields, notes, geolocation JSON/distances, flags, metadata, source type, sign-off state, and breaks. Future schema columns can therefore appear without an endpoint change. - JSON database columns are returned in the database driver’s raw string representation rather than decoded objects.
- There is no user filter or pagination. The aggregate feed supplies its configured date range and exposes the result as
user_clockins.
See it in Fieldmotion
CRM1
The legacy connector uses this result as its User Clockins table.
CRM2
CRM2 does not call this reporting route for timekeeping screens.
Related endpoints
PowerBI_getDatais the supported aggregate connector feed and supplies tenant settings to this helper.PowerBI_authenticateestablishes the unsigned connector session used by the aggregate feed.