Forum Discussion
toovishant
1 year agoHelper II
What details required to connect REST API to Power BI
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://---------------------/GetAllBuildingsPublicBa...
- 1 year ago
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
kushanNa
1 year agoSuper User
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
- toovishant1 year agoHelper II
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.
- kushanNa1 year agoSuper User
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- toovishant1 year agoHelper II
It worked Thank You kushanNa .