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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ellisx
New Member

REST query URL with parameters from initial query, with secure key

How can I retrieve data from a REST API which requires key headers that depends on an initial query to first get the parameters.

 

e.g. my first query gets a list of building IDs, I then need to loop through each building to retrieve the data about them with a URL like: https://api.buildings.com/api/occupancy?buildingID=1

I can add the secret key into the first query, but I don't know how to tell it to loop through the queries and second level queries and include headers, and I can't find any tutorials or information on how to do it.

1 ACCEPTED SOLUTION
ellisx
New Member

answered my own question, for anyone else struggling, edit the query and add the headers in, you can view the way to do this by clicking on advanced editor on a query that has the key in, it will look like this:

 

Source = Json.Document(Web.Contents("https://api.buildings.co.uk/api/homes", [Headers=[key="9fw8hdfdhs9fhsd8fhusdh"]]))

View solution in original post

1 REPLY 1
ellisx
New Member

answered my own question, for anyone else struggling, edit the query and add the headers in, you can view the way to do this by clicking on advanced editor on a query that has the key in, it will look like this:

 

Source = Json.Document(Web.Contents("https://api.buildings.co.uk/api/homes", [Headers=[key="9fw8hdfdhs9fhsd8fhusdh"]]))

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Kudoed Authors