Forum Discussion
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
Unfortunately i get an error:
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?
- Anonymous6 years ago
Hi Rena,
Thanks for your message. I tried your solution, but unfortunatelly I get this error:
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
2 Replies
- AnonymousNot applicable
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.
how to connect my web api wtih Power BI Reports?
Best Regards
Rena
- AnonymousNot applicable
Hi Rena,
Thanks for your message. I tried your solution, but unfortunatelly I get this error:
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