# Power bi access to serviceM8

**URL:** <https://community.servicem8.com/t/power-bi-access-to-servicem8/1083>\
**Category:** General\
**Created:** [April 22, 2026, 3:26am UTC](https://community.servicem8.com/t/power-bi-access-to-servicem8/1083 "2026-04-22T03:26:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stan\_gifford](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@stan\_gifford](https://community.servicem8.com/u/stan_gifford)\
**Post date:** [April 22, 2026, 3:26am UTC](https://community.servicem8.com/t/power-bi-access-to-servicem8/1083/1 "2026-04-22T03:26:37Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![Cody](https://sea2.discourse-cdn.com/flex002/user_avatar/community.servicem8.com/cody/32/52_2.png) [@Cody](https://community.servicem8.com/u/Cody)\
**Post date:** [April 25, 2026, 3:28am UTC](https://community.servicem8.com/t/power-bi-access-to-servicem8/1083/2 "2026-04-25T03:28:27Z")

</div>

Hi Stan,

For the ServiceM8 REST API, the documented “private application” approach is to authenticate by sending your API key in the `X-API-Key` header on every request.

A couple of ServiceM8-specific checks based on your example:

- Make sure you’re using an API Key created in ServiceM8 under Settings → API Keys (rather than an OAuth access token).
- The “List all Jobs” endpoint is `GET https://api.servicem8.com/api_1.0/job.json`, and the API key is supplied via the `X-Api-Key` request header.

If you’re currently combining `X-API-Key` with HTTP Basic Auth in Power BI, it’s worth trying the request using only the documented header approach (and matching the header name exactly as shown in our docs).

If your setup requires OAuth instead, ServiceM8 also supports OAuth 2.0, and you can call the API by sending the access token as `Authorization: Bearer {access_token}`.

Also, make sure you don’t post your API key in screenshots or code samples publicly.

If you’re still getting a 401 after switching to the `X-API-Key` approach, email [support@servicem8.com](mailto:support@servicem8.com) with the key redacted and the full error text, and we’ll investigate.

Thanks,  
Cody
