Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi All,
Here are the Rest API details I have and unable to connect, not sure I follow the rest steps to connect. Please help.
curl -X 'GET' \ 'https://---------------------/GetAllBuildingsPublicBasic?PageNumber=1&PageSize=5000' \ -H 'accept: */*' \ -H 'x-api-key: ---------------'
Any help apperciated.
Thank You
Vishant
Solved! Go to Solution.
Hi @toovishant
click get data > blank query > advanced editor > copy and past the following code and fill it up with the url and api key > click edit credentials > pick Anonymous > connect and see if it works ?
let
Source = Json.Document(Web.Contents("https://---------------------/GetAllBuildingsPublicBasic?PageNumber=1&PageSize=5000",
[
Headers = [
#"accept" = "*/*",
#"x-api-key" = "---------------"
]
]
))
in
Source
Hi @toovishant
click get data > blank query > advanced editor > copy and past the following code and fill it up with the url and api key > click edit credentials > pick Anonymous > connect and see if it works ?
let
Source = Json.Document(Web.Contents("https://---------------------/GetAllBuildingsPublicBasic?PageNumber=1&PageSize=5000",
[
Headers = [
#"accept" = "*/*",
#"x-api-key" = "---------------"
]
]
))
in
Source
You Rock My Friend @kushanNa - It worked like a magic.
I think there are other steps to get the data. Please can you proivde if possible.
No worries , click list > to table > ok > click expand column button and see if it expands the data ?
or try this code
let
// Get the raw JSON
Source = Json.Document(Web.Contents("https://---------------------/GetAllBuildingsPublicBasic?PageNumber=1&PageSize=5000",
[
Headers = [
#"accept" = "*/*",
#"x-api-key" = "---------------"
]
]
)),
// Navigate to the "value" key which contains the list
ValueList = Source[Value],
// Convert list to table
ToTable = Table.FromList(ValueList, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
// Expand the records into columns
Expanded = Table.ExpandRecordColumn(ToTable, "Column1", {"Name", "Value"})
in
Expanded
Hey @kushanNa - What if I want to connect via the api key what details and steps required?
Should I go via the Connect data >Web>Web API
not sure what details need to enter in "Key", As mentioned earlier I have these details.
curl -X 'GET' \ 'https://---------------------/GetAllBuildingsPublicBasic?PageNumber=1&PageSize=5000' \ -H 'accept: */*' \ -H 'x-api-key: ---------------'
Thank You
To the best of my knowledge, the 'key' is typically used with a general header like 'Authorization', but in your case, you’re using a custom header like 'x-api-key'
I get the follow error when i try to use WEB and API key, I am using the right details to autheticate and connect API?
Hey, what's your issue? M code should look like this:
let
url = "https://---------------------/GetAllBuildingsPublicBasic?PageNumber=1&PageSize=5000",
apiKey = "---------------",
response = Web.Contents(url,
[
Headers = [
#"accept" = "*/*",
#"x-api-key" = apiKey
]
]
),
json = Json.Document(response)
in
json
It should work
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
63 | |
63 | |
52 | |
36 | |
36 |
User | Count |
---|---|
80 | |
71 | |
58 | |
45 | |
44 |