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
jwillis07
Helper I
Helper I

How to Authenticate a REST API in Power BI?

Good evening all, I'm in need of some help and I hope I've come to the right place...

 

I've only ever worked with local files or open APIs however this time, I'm trying to access a REST API but I'm currently unable to get past the authentication.

 

The API URL is... https://psa.pulseway.com/api/servicedesk/tickets

The documentation for the API can be found at... https://psa.pulseway.com/api

 

Within the documentation it says that I need to include the following header parameters...

 

Accept = application/json

Content-Type = application/x-www-form--urlencoded

grant_type = password

username = Authenticated user username value (my Pulseway username)

password = Authenticated user password value (my Pulseway password)

tenant = Authenticated user company tenant value (my Pulseway company tenant name)

 

So, in Power BI Desktop, I'm following the below steps:

 

1. Get Data > Other > Web

2. Click advanced, and enter my API URL as whole, not in parts.

3. Add in the header parameters as above, when complete, it looks like the below:

 

jwillis07_0-1623009985613.png

jwillis07_1-1623010037980.png

*I've left my credentials blank for security purposes but I fill them in before moving to the next step 

 

4. Press OK

5. I then get a failure to authenticate message as below,

jwillis07_2-1623010348372.png

 

6. As I've already included my credentials in the headers, I believe I should now just click "Anonymous" and then "Connect" - Only this doesn't work and I get the same error message again...

jwillis07_2-1623010348372.png

 

 

I have no idea what I'm doing wrong and have gotten lost in documentation to just get this far, so if anyone can point me in the right direction it'd be hugely appreciated and you might just save my job!

 

Thank you in advance,

Jason

4 REPLIES 4
Pree
New Member

Did you solve the problem? I am getting the same error. I am looking for the soluction to this problem too. 

v-henryk-mstf
Community Support
Community Support

Hi @jwillis07 ,

 

If you want to Authenticate a REST API in Power BI. You should first need to clear the permission in the data source setting, the choose "Web API" instead of "Anonymous", then make a try.

v-henryk-mstf_2-1623309341212.png

 

v-henryk-mstf_0-1623309205142.png

 

Provide corresponding official documents for reference: Power Query Web connector | Microsoft Docs


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi v-henryk-mstf!

I think what we are looking for is a way to pass the authentication in the header INSTEAD of the Web API Key
If indeed that would be the method for activating auth through the header parameters in the case described, what would one write in the KEY-field? Would that be whatever was returned with the Authorization: Basic?

jwillis07
Helper I
Helper I

If anyone even has any links to tutorials or anything, it would help more than you know.

I just can't get my head around this 😞

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.