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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
dstramilov
Helper II
Helper II

Two or more API queries - refresh error

In Desktop version  I am using Function to get token and pass it  to actual json API queries (10+), but Function feels like doesn't work for API resfresh when I publish data to Power Bi, how can I get data for several queries without Function?
Curently I embed login & pass into each query header & I am getting error on refresh.
In my case token is valid for 15 min, every time I call I am getting new token. 
 
 
Last refresh failed: Thu May 19 2016 08:15:15 GMT-0800 (Alaskan Daylight Time)
Can't connect to the data source.Hide details
Data source type:
Data source error: The credentials provided for the Web source are invalid. (Source at https://api.linkgoeshere.com/reportnamegoeshere.)
Cluster URI: WABI-WEST-US-redirect.analysis.windows.net
Activity ID: 9cf81dee-f58c-4fac-aa54-dbb269d0ee85
Request ID: ad596f2c-9efb-032a-e15d-90822eb6351b
Time: 2016-05-19 16:15:15Z

1 ACCEPTED SOLUTION

Problem is solved by edit time delay between queries.

View solution in original post

2 REPLIES 2
dstramilov
Helper II
Helper II

I am using this query type for each report, so I could have 10+ queries for one data set.

 

let
 authKey = "{""Username"":""USERNAME"",""Password"":""PASSWORDGOESHERE"",""LocationID"":""LOCATIONIFNEEDED""}",
 url = "https://APILINKGOESHERE.com",
 // Uses the authentication/token method to obtain a token
 GetJson = Web.Contents(url,
     [
         Headers = [#"Content-Type"="application/json"],
         Content = Text.ToBinary(authKey),
         RelativePath="/Authentication/AuthorizeUser"
     ]
 )
in
    GetJson

 

Problem is solved by edit time delay between queries.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.