Forum Discussion
API authentication error on scheduled refresh!
- 7 years ago
Try this, substituting in your api key, and see if you see the same error
let
vBaseUrl = "https://api.projectmanager.com",
vPath = "api/v1/projects.json",
vHeaders = [ #"apikey"="this is where i put my key" ],
Source = Web.Contents ( vBaseUrl, [RelativePath=vPath, Headers=vHeaders] ),
Json = Json.Document ( Source )
in
Json
Try this, substituting in your api key, and see if you see the same error
let
vBaseUrl = "https://api.projectmanager.com",
vPath = "api/v1/projects.json",
vHeaders = [ #"apikey"="this is where i put my key" ],
Source = Web.Contents ( vBaseUrl, [RelativePath=vPath, Headers=vHeaders] ),
Json = Json.Document ( Source )
in
Json
the relative path setting is critical and solve issues with API when have cradentials indicate a failure on refresh.
see also Using The RelativePath And Query Options With Web.Contents() In Power Query And Power BI M Code