Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Connect Power BI to a web API (breathe hr)

Hi,

 

I'm trying to connect to Breathehr.com, which is a web based service. Trail gives you all options to play with it so went for it and created some dummy data. Sadly I can't connect to the API using the key.

 

They say on their website:

"Authentication to the breathe API is achieved with a token, sent in the HTTP headers of every request. The X-API-KEY header should contain the string shown in the app on/settings/modules/api_setup"

 

There are two kesys to be found. Production and sandbox:

" prod-GCcDDZpORrpQDXdAmRqoZg17-ElVGaqlSyHUaplPa8I; sandbox-y3et1u8ZDZN_NcNQtAzjuIdMuS704vGLlcVqoRstwuo" 

 

I'm tryingto use one of them as it was suggested by the community in few topics:

 

let
    Source = Json.Document(Web.Contents("https://hr.breathehr.com/allowances?identifier=centiq", [Headers =[Authorization="Bearer " & "prod-GCcDDZpORrpQDXdAmRqoZg17-ElVGaqlSyHUaplPa8I"]]))
in
    Source

 

 

web.jpg

Unfortunately i get an error:

error.jpg

 

Also, if i try this:

 

let
    Source = Json.Document(Web.Contents("https://hr.breathehr.com/allowances?identifier=centiq", [Headers=[#"x-api-key"="prod-GCcDDZpORrpQDXdAmRqoZg17-ElVGaqlSyHUaplPa8I"]])),
    #"Converted to Table" = Record.ToTable(Source)
in
    #"Converted to Table"

 

Same error happens:

"DataSource.Error: The downloaded data is HTML, which isn't the expected type. The URL may be wrong or you might not have provided the right credentials to the server."

 

Can anyone help?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Rena,

 

Thanks for your message. I tried your solution, but unfortunatelly I get this error:

pchmurzynski_0-1600692202425.png

 

It was a stupid mistake. I was using a wrong link. Rather, than the URL showing report i was interested, I should've used what the service suggested in the documentation:

https://api.breathehr.com/v1/employees

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

Please connect to the web page by clicking "Get data"-> Web, then select Basic, enter your email address as the user name and the API Token as the password. Later check whether it can resolve the problem.

If the above one is not working, you can also refer the following documentations to get it.

API Strategies with Power BI

how to connect my web api wtih Power BI Reports?

REST API and Authentication

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Rena,

 

Thanks for your message. I tried your solution, but unfortunatelly I get this error:

pchmurzynski_0-1600692202425.png

 

It was a stupid mistake. I was using a wrong link. Rather, than the URL showing report i was interested, I should've used what the service suggested in the documentation:

https://api.breathehr.com/v1/employees

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.