When to use this endpoint

Use PowerBI_getAssetLocationHistoryData for movement history with resolved location names and addresses. Use the aggregate feed’s asset_location_history module for connector refreshes.

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

ParameterTypeRequiredDescription
fromStringNoAn exact lower-bound fragment such as >="2026-09-01". It is not a plain date.
toStringNoAn exact upper-bound fragment such as <="2026-09-30 23:59:59". It is not a plain date.
aidsNative array of IDsNoRestricts rows to positive integer asset IDs. Values are integer-normalised, de-duplicated, and invalid/nonpositive values discarded.

Example request

FM_api('PowerBI_getAssetLocationHistoryData', [
	'from' => '>="2026-09-01"',
	'to' => '<="2026-09-30 23:59:59"',
	'aids' => [481],
]);

Example response

[
  {"movement_id":"91","asset_id":"481","asset_name":"Pump 7","location_type_id":"1","location_id":"1042","location_type":"Customer","location_name":"Example Ltd","location_address":"1 Main Street, Belfast","start_time":"2026-09-03 08:00:00","end_time":null,"is_active":"1","job_id":"0","user_id":"18"}
]

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":"invalid parameter: from"}A nonempty from does not match the exact lower-bound form.
{"error":"invalid parameter: to"}A nonempty to does not match the exact upper-bound form.

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

Behaviour and edge cases

  • Date filtering is applied only when both bounds are nonempty. It selects movements that overlap the window: start is at or before the upper bound, and a blank/zero end is treated as open-ended.
  • Rows for soft-deleted source assets are excluded. Movements linked to deleted customers, destination assets or work areas remain, but the deleted destination’s resolved name becomes null.
  • location_type_id 0, 1, and 2 map to Location, Customer, and Asset. Addresses are returned only for Location and Customer destinations.
  • Results are ordered by movement ID descending and are not paginated.

See it in Fieldmotion

CRM1

The legacy connector exposes these rows as asset_location_history_data.

CRM2

CRM2 asset-history screens use their own endpoints; this route supplies reporting data.

Related endpoints

  • PowerBI_getData is the supported aggregate connector feed and supplies tenant settings to this helper.
  • PowerBI_authenticate establishes the unsigned connector session used by the aggregate feed.