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
Anderrated
Frequent Visitor

Internal server error (500) when connecting to API with Bearer Token

Hi,

 

So I am trying to connect to an API that requires a Bearer token. When I try to simulate in POSTMAN I successfully get the response data I need:

 

POSTMAN.png

 

 

Here you can see the different Headers 

 

POSTMAN2.png

 

 

But when connecting to PowerBi as "Anonymous" and adding all the Headers I get the error message

PowerBI.pngPowerBi2.png

 

The server is up as I am getting a response from POSTMAN. So I don't know what I am doing wrong.

 

Thanks for your help

2 REPLIES 2
Anonymous
Not applicable

Hi @Anderrated ,

Base on your description and screenshots , you are encountering issues when connected to the API in Power BI Desktop. However, you are able to successfully connect to the API using Postman. The '500 Internal Server Error' typically indicates a server-side issue, could you please check and confirm the following info?

  • Ensure the Bearer token used in Power BI is the same as in Postman and the token hasn't expired.vyiruanmsft_0-1720592417513.png
  • Make sure all the headers are same in Power BI Desktop as in Postman
  • Update the version of your Power BI Desktop to the latest one

In addition,  you can refer the following link to connect to API.

Power BI REST API: Step-by-step Guide to Use It 

Or create a blank query in Power Query Editor with the following codes:

let
    url = "https://example.com/api/endpoint",
    headers = [
        #"Authorization" = "Bearer YOUR_BEARER_TOKEN",
        #"Content-Type" = "application/json"
    ],
    response = Web.Contents(url, [Headers=headers]),
    jsonResponse = Json.Document(response)
in
    jsonResponse

Best Regards

Hi @Anonymous 

 

Thanks for your reply. I have tried what you mentioned but obtained the same result. Blank query returns the same error message: Internal server error (500). The token is not expired and is the same. Do you have any more ideas?

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.