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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DataDave
Helper I
Helper I

How do I chain API calls?

The Australian government has made thousands of datasets available through their OpenData initiative. I'm playing with the following dataset:

I have created a Web Datasource based on this URL: airquality.des.qld.gov.au/v1/stations

  • This returns a JSON object listing all the air quality sensor stations.
  • I can converted the JSON to a table.

I'd like to make a subsequent call to the URL: airquality.des.qld.gov.au/v1/stations/{station_id}/parameters/measurements

  • As you can see, this takes the station_id from the previous URL as an input
  • It's going to return a dataset per station, which I'm happy to store in a single "measurements" table

I tried to create a parameter from the stations dataset and use it in the URL to obtain the measurements datasets, but that gave me a "please rebuild this data combination" error.

 

I am now trying to follow

but it's a little confusing.

 

Any help is appreciated.

1 ACCEPTED SOLUTION
blopez11
Resident Rockstar
Resident Rockstar

I've run into this many times when using web service APIs

To get around this you'll likely have to encapsulate the data sources, at least maybe for stations, into a function

So maybe, GetStation () which just returns the JSON

The caller can convert the JSON into a list, then use this to adjust the URL to get the measurements

 

It is a pain, but it works.   The following quote from the article below helped me find a solution when I encountered the same as you

"Embedding or masking your Data Sources inside Functions – this method will make your data sources not visible to the Data Privacy Levels at first, but you can tune your queries to define the data source at first and then apply a function."

https://www.poweredsolutions.co/2019/03/12/data-privacy-and-the-formula-firewall/

View solution in original post

1 REPLY 1
blopez11
Resident Rockstar
Resident Rockstar

I've run into this many times when using web service APIs

To get around this you'll likely have to encapsulate the data sources, at least maybe for stations, into a function

So maybe, GetStation () which just returns the JSON

The caller can convert the JSON into a list, then use this to adjust the URL to get the measurements

 

It is a pain, but it works.   The following quote from the article below helped me find a solution when I encountered the same as you

"Embedding or masking your Data Sources inside Functions – this method will make your data sources not visible to the Data Privacy Levels at first, but you can tune your queries to define the data source at first and then apply a function."

https://www.poweredsolutions.co/2019/03/12/data-privacy-and-the-formula-firewall/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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