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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Problem while connecting to REST API with Power BI

I'm trying to connect to a REST API with PBI's power query, but for some reason I get the following message: 

lanksu70_0-1731415727538.png

lanksu70_1-1731415789181.png

The login information is 100% correct, and I have made the same API calls with Postman and they work without any problems. I have tried editing the data source settings and everything else that I can find, but I haven't been able to solve this. 

I have the API calls made in advanced editor, and I can see the actual data that is coming through in the preview, but when I click "Close & Apply" I get this error. 

 

Any help is greatly appreciated 🙂

 

4 REPLIES 4
PowerBIKoleSlaw
Regular Visitor

Hi @Anonymous - not sure if you ever figured this out, but I stumbled upon your post when I was facing the same issue today.  What I noticed was that anytime I would make a change to my table, my header & token were being dropped. After I made my changes, I went into Advanced Editor and re-added my header & token and everything worked again.  Hope this helps!

Anonymous
Not applicable

Thanks for the reply @Poojara_D12 ! 

I tried those things, but I was unable to advance. I have tried other things as well, but without any success.

 

So, I am trying to do a POST command to get a bearer token, but then I get the error seen in my first post. However, I am able to do GET commands through using a bearer token which I got from Postman. Those GET commands get me data from the API and I can make visuals from them etc, so the problem has to do something with the POST command and PBI. The function to make the POST call is from a official template published by the developers of the software which API I am trying to connect, so there shouldn't be any problems. 

 

Do you or others have any ideas that I could try? Thanks in advance!

Anonymous
Not applicable

Hi @Anonymous 
Did Poojara_D12   reply positively solve your problem, if yes, then you can mark his reply as a solution. If you have any other questions, you can go ahead and ask them below.

Best regards,
Albert He

Poojara_D12
Super User
Super User

Hi @Anonymous 

 

Thank you for the screenshot and detailed explanation! It sounds like the issue might be related to Power BI's authentication configuration for the API, rather than the API or credentials themselves.

Here are some steps you can try to troubleshoot and potentially resolve the issue:

  1. Check Authentication Method:
    Make sure you're selecting the correct authentication method in Power BI. If your API requires an API key or a bearer token, use the "Web API" option instead of "Anonymous" or "Basic." You may need to enter the token or key in this section.

  2. Check Data Privacy Settings:
    Sometimes, Power BI’s data privacy settings can interfere with API calls. To adjust this:

    • Go to File > Options and settings > Options.
    • In the Global section, under Privacy, set Data Privacy to "Ignore the privacy levels."
    • You might also want to set the privacy level of the source to Public if it’s not sensitive.
  3. Edit Permissions:
    If you've tried multiple authentication methods without success, Power BI might be using cached permissions. To reset them:

    • Go to File > Options and settings > Data source settings.
    • Select the API data source and click Clear Permissions.
    • Reconnect with the correct settings and credentials.
  4. Check API Rate Limits and Restrictions:
    If you’re previewing data but get an error on applying changes, it could be due to API rate limits or specific query parameters that Power BI’s connection doesn’t handle well. Check the API documentation to see if there are any known limitations or additional headers required.

  5. Testing in Advanced Editor:
    Sometimes Power BI will show previews but fail to authenticate on apply if there’s a complex query structure. Review your code in the Advanced Editor and try breaking it down to simpler steps if possible.

  6. Use Headers for Authentication:
    If the API requires headers like Authorization (e.g., Bearer <token>), you may need to manually add those in the query steps. This is especially useful if the "Web API" method doesn’t work.

  7. Use a Custom Connector:
    If nothing else works, you may need a Power BI custom connector to handle specific authentication methods or complex API requirements. Microsoft has resources on developing custom connectors, though this approach requires some coding.

Try these steps and let me know if any of them resolve the issue!

 

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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