When to use this endpoint

Use PowerBI_authenticate only when building or diagnosing the legacy Power BI feed. Normal API clients should use the signed API-key authentication described in Getting started.

Authentication and permissions

This endpoint is itself an authentication mechanism: it accepts the unsuffixed API key ID and secret directly and does not require an existing CRM session or signed request.

It verifies that the global key row and its tenant user row exist, installs that user in the session, defines the tenant database prefix, and loads the tenant configuration. It performs no page/role check and does not separately reject an inactive user or inactive tenant.

Parameters

ParameterTypeRequiredDescription
api_idInteger-compatibleYesThe API key ID. The database lookup coerces this value to an integer.
api_keyStringYesThe corresponding raw API key value. Treat it as a secret and send it only over HTTPS.

Example request

FM_api('PowerBI_authenticate', [
	'api_id' => POWER_BI_API_ID,
	'api_key' => POWER_BI_API_KEY,
]);

Example response

{"ok":1}

Errors and unusual responses

ResponseCondition
{"error":"no API id supplied"}api_id is absent or empty.
{"error":"no API key supplied"}api_key is absent or empty.
{"error":"invalid credentials"}The key pair does not match a global key row, or its referenced tenant user row no longer exists.
{"error":"please do not use the PowerBI functions while logged into another account"}The request already defined a tenant database prefix for a different tenant.

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

Behaviour and edge cases

  • Authentication takes a per-credential filesystem lock. A concurrent request waits while a lock newer than 120 seconds exists; the lock is released explicitly by the aggregate feed and by a shutdown handler on errors or early termination.
  • A successful direct call returns immediately and relies on shutdown cleanup for its lock.
  • The endpoint does not read the connector tenant’s Power BI module or date-range settings.

See it in Fieldmotion

CRM1

The legacy Power BI connector calls this indirectly through PowerBI_getData; there is no interactive CRM1 screen for the route.

CRM2

CRM2 does not call this route directly. Power BI configuration is managed in tenant settings.

Related endpoints

  • PowerBI_getData authenticates and returns the configured datasets in one request.