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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
KieranQuinn1
Regular Visitor

API Data not refreshing because of token

I have a power bi Report built using a call to a local API

 

First thing I did was to invoke the authorisation token which after a while i got working.  I am then using the gettoken function in 3 sub functions 

response = Json.Document(Web.Contents("???/system/api/v1/auth/token",[Content=Json.FromValue(data),Headers=header])),

 

This is one of the queries

Source = Json.Document(Web.Contents("??/intent/api/v1/topology/l2/"&Vlan, [Headers=[#"x-auth-token"=GetToken()]]))

 

KieranQuinn1_0-1694533786284.png

 

I understand why power bi does not like this because it needs to call this function

 

I read i can try spitting up the URL using query but this has proved unsucessful

 

I changed this 

Source = Json.Document(Web.Contents("??/intent/api/v1/topology/l2/"&Vlan, [Headers=[#"x-auth-token"=GetToken()]]))

to

Source = Json.Document(Web.Contents("???/intent/api/v1/topology/",
[RelativePath="l2/",
Query=[Vlan=Vlan,
Headers=[#"x-auth-token"=GetToken()]]]))

 

Any help would be really appreciated

 

Thanks

 

 

 

1 REPLY 1
Anonymous
Not applicable

Hi @KieranQuinn1 ,

 

Here are a few suggestions you can try:

Check token expiration: Make sure the token you’re using hasn’t expired. If it has, you’ll need to refresh it before making API requests.

Verify token usage: Ensure that you’re correctly passing the token in the headers of your API requests. Double-check the syntax and make sure it matches the expected format.

 

 

 

Best Regards,

Stephen Tao

 

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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