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
Gabry
1 year agoSuper User
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