This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
I am in the process of putting a dashboard together in PowerBI - the data is sourced from both ServiceM8 and Buz.
The BUZ side is working fine.
The serviceM8 is not 😞
I have successfully got data back from serviceM8 using power automate. ServiceM8 requires an application key x-api-key and basic authentication. Like I say this works perfectly in power automate.
In PBI I have made a blank query and using advanced editor put the following code in;
let
// Replace with your actual token
access_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
// API endpoint example: Get all jobs
Source = Json.Document(
Web.Contents(
"https://api.servicem8.com/api_1.0/job.json",
[
Headers = [
#"x-Api-Key" = access_token,
Accept = "application/json"
]
]
)
),
// Convert JSON to table
ToTable = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
Expanded = Table.ExpandRecordColumn(ToTable, "Column1")
in
Expanded
Like I say, I have to use basic authentication however when I run the query it chucks a wobbly saying "'x-Api-Key' header is only supported when connecting anonymously. "
If I change the authentication to anonymous, the query fails (Authentication error).
In my mind I have a workaround - which may or may not work - write a small power automate and use that to retrieve the data from serviceM8 - however I would prefer to go directly.
Any advice, thoughts, special prayers you can offer me?
Stan
Solved! Go to Solution.
Hi @stan_w_gifford,
This issue occurs because Power BI supports only one authentication method per data source, and built-in options like Basic authentication automatically handle the Authorization header. On the other hand, Web.Contents lets you add custom headers for manual authentication. Since ServiceM8 requires both Basic authentication and an API key header, this can create a conflict with Power BI’s authentication model. To resolve this, use Anonymous authentication and manually add both the Authorization and x-api-key headers in Web.Contents, as recommended by Microsoft for header-based authentication scenarios.
Power Query Web Connector - Power Query | Microsoft Learn
Web.Contents - PowerQuery M | Microsoft Learn
Handling authentication for Power Query connectors - Power Query | Microsoft Learn
Tutorial: Integrate Power BI with key phrase extraction - Foundry Tools | Microsoft Learn
Thank you.
Sorry for late reply - we have been on anzac day weekend in aus (Lest we forget)
After looking at the very helpfull replies, I have actually found that the key is not needed - just basic auth.
I suspect that this may change in the future however for the moment I am proceeding with everything good.
Stan
HI @stan_w_gifford,
Have you had a chance to review the solution we shared earlier? If the issue persists, feel free to reply so we can help further.
Thank you.
Important:
In Data Source Settings go to Credentials, mark it set it to:
Anonymous
This will work because:
In Power BI, no longer tries to override headers
You will fully control authentication
If this helps, ✓ Mark as Kudos | Mark as Solution| Help Others
Hi @stan_w_gifford,
This issue occurs because Power BI supports only one authentication method per data source, and built-in options like Basic authentication automatically handle the Authorization header. On the other hand, Web.Contents lets you add custom headers for manual authentication. Since ServiceM8 requires both Basic authentication and an API key header, this can create a conflict with Power BI’s authentication model. To resolve this, use Anonymous authentication and manually add both the Authorization and x-api-key headers in Web.Contents, as recommended by Microsoft for header-based authentication scenarios.
Power Query Web Connector - Power Query | Microsoft Learn
Web.Contents - PowerQuery M | Microsoft Learn
Handling authentication for Power Query connectors - Power Query | Microsoft Learn
Tutorial: Integrate Power BI with key phrase extraction - Foundry Tools | Microsoft Learn
Thank you.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |