Power BI
Retrieve the legacy Power BI feed
/a/PowerBI_getData
Return the configured Power BI datasets through the legacy connector’s self-authenticating JSON feed.
When to use this endpoint
Use PowerBI_getData as the entry point for the legacy Fieldmotion Power BI custom connector. New Power BI integrations should normally use the read-only OData feed instead.
Use module and, where supported, dataset to refresh one table without constructing the larger legacy payload.
Authentication and permissions
This route accepts the raw api_id/api_key pair and calls PowerBI_authenticate; a pre-existing signed API request is not required. The key and tenant user must exist.
The authenticated user is not checked against a page/role permission. The endpoint serialises concurrent exports for the same key with a filesystem lock and releases it on normal completion, configuration errors, and shutdown.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_id | Integer-compatible | Yes | Raw API key ID used by the connector authentication helper. |
api_key | String | Yes | Raw API key value. Send only over HTTPS and avoid request logging. |
module | String | No | Overrides the configured module list for this request. Supported values include areas, assets, all_assets, asset_location_history, contracts, all-contracts, customers, all_customers, form_data, table_data, invoices, invoice_lineitems, jobs, purchase_orders, purchase_order_line_items, quotes, quote_line_items, all_recurrences, all-sors, all-stock, all-users, skills, user_skills, user_clockins, and all. |
dataset | String | No | Return only one key for projected modules: assets accept asset_data, asset_custom_data, or asset_table_data; customers accept customer_data or customer_table_data; invoices, purchase orders, and quotes accept their main or *_lineitem_data key. The dataset must match module. |
Example request
FM_api('PowerBI_getData', [
'api_id' => POWER_BI_API_ID,
'api_key' => POWER_BI_API_KEY,
'module' => 'customers',
'dataset' => 'customer_data',
]);
Example response
{
"customer_data": [
{"customer_id":"1042","customer_name":"Example Ltd","area_id":"8"}
]
}
Without dataset, the object contains the selected module keys plus compatibility placeholders for many unselected tables. The principal keys are areas_data, asset_data, asset_custom_data, asset_table_data, asset_location_history_data, contract_data, customer_data, customer_table_data, form_data, table_data, invoice_data, invoice_lineitem_data, job_data, purchase_order_data, purchase_order_lineitem_data, quote_data, quote_lineitem_data, recurrence_data, sor_data, stock_data, user_data, skills, user_skills, and user_clockins.
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"no API id supplied"} / {"error":"no API key supplied"} | A raw credential is missing. |
{"error":"invalid credentials"} | The raw key pair or referenced user is not valid. |
{"error":"invalid parameter: dataset"} | dataset is not valid for the requested module. |
{"error":"power-bi setting not selected"} | The tenant power-bi setting is not a nonempty array, even when module was supplied. |
{"error":"power-bi-date-from setting not selected"} | The configured start date is not exactly YYYY-MM-DD. |
{"error":"power-bi-date-to setting not selected"} | The configured end date is not exactly YYYY-MM-DD. |
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 tenant
power-bi,power-bi-date-from, andpower-bi-date-tosettings are mandatory. Supplyingmodulereplaces the selected module list after that validation and is not checked against the configured selections. - Date-bounded modules receive an inclusive start at the configured date and an inclusive end at
23:59:59on the configured end date. “All” customer/asset variants and master-data modules ignore that range. - With no projection, missing datasets are usually represented as
[{}];asset_custom_datauses{}. These placeholders exist for legacy Power Query navigation, not as records. module=allexports date-bounded invoices, jobs, purchase orders, and quotes; related customers/assets; and broad master datasets. It does not include Areas or recurrences. Its legacyquote_lineitem_datakey currently repeatsquote_datarather than quote line items.- The request body is decoded but otherwise ignored. All controls come from request parameters and tenant settings.
- This endpoint exits after streaming its object and can return legacy application errors with HTTP 200.
See it in Fieldmotion
CRM1
The tenant Power BI settings choose modules and a date range. The legacy custom connector calls this feed to build its navigation tables.
CRM2
CRM2 does not use this feed for its own screens. Tenant Power BI configuration still controls normal unqualified refreshes.
Related endpoints
PowerBI_authenticateimplements its raw-key authentication and locking.PowerBI_getCustomerDataand the otherPowerBI_get*Dataroutes implement individual datasets.