Christy -- Insert your token value within the
token
step below:
let
token = "<your token here>",
endpoint = "locations",
baseUrl = "https://www.ncdc.noaa.gov/cdo-web/api/v2/",
url = Text.Combine({baseUrl,endpoint}),
limit = 1000,
request = Web.Contents(
url,
[
Headers = [
token = token
],
Query = [
limit = Text.From(limit)
]
]
),
requestData = Json.Document(request),
metadata = requestData[metadata],
results = requestData[results],
#"Converted to Table" = Table.FromRecords(results)
in
#"Converted to Table"
Tony
------------------------------
Tony McGovern
co-Founder & Data Scientist
Emdata Inc.
------------------------------
Original Message:
Sent: May 31, 2019 09:09 AM
From: Christy Miller
Subject: Web API Call with Header
I am trying to connect Power BI to NOAA data - https://www.ncdc.noaa.gov/cdo-web/webservices/v2#gettingStarted
I want to get a list of available locations for example: https://www.ncdc.noaa.gov/cdo-web/api/v2/locations
I have requested a token and the instructions reference that the token has to be in the header, but I cannot figure out the proper way to get the header into the HTTP request header parameters.
Any advice that can be provided is appreciated!
------------------------------
Christy Miller
2813565347
Magnolia
2813565347
------------------------------