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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
daniel_digi
New Member

Web.Content API Call failing in main editor but not Query Editor

I have built a report that utilises Web.Contents to make calls to several endpoints of an API. Using the Relative Path method (see snippet) I have been able to sucessfully publish the report to the web and it has been working for several months.

 

AccessTokenHeader = "bearer " & ClientAccessToken, 
 GetJson = Web.Contents(api_uri,
     [
         RelativePath = "api/1.1/xxx",
         Headers = [#"Authorization"=AccessTokenHeader]
     ]
 )

 

About a week ago I started receiving the following error: The credentials provided for the Web source are invalid. (Source at https://api.xxx.com.au/api/x.x/xxx/xxx/xxx)

 

I opened the report in Power Bi Desktop and received the same error when doing a refresh in the main editor. Interestingly across multiple refreshes the endpoint that presents the error can change. 

 

However, if I open the Query Editor and individually refresh the queries they all return data without issue. If I do this and then click Close and Apply it starts the refresh and eventially the prompt for me to choose how to authenicate appears. I pick anonymous and it then fails. 

 

Has anyone had a similar experience?

3 REPLIES 3
mahoneypat
Employee
Employee

Do you know that the token hasn't expired or hasn't been deactivated?

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


The token gets regenertated each time the dataset gets refreshed so I don't think it would be related to this.  

daniel_digi
New Member

UPDATE: After going back in the Query Editor after attempting the refresh in main editor is now failing in Query Editor as well. 

 

So now I am ever more confused as to why this has stopped working.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors