Forum Discussion
Ryder
6 years agoFrequent Visitor
Converting Postman Request to run directly from PowerBI
Hey All, This is an ongoing issue i've been trying to solve to remove the postman step from my powerBI process. I'm an analyst not a coder so getting the syntax correct to run this request direc...
tonmcg
Resolver II
6 years agoUse `https` instead of `http`, meaning change the first parameter of `Web.Contents` to "https://api.ongage.net", like so:
request = Web.Contents(
"https://api.ongage.net",
[
Headers = [
#"X_USERNAME" = username,
#"X_PASSWORD" = password,
#"X_ACCOUNT_CODE" = accountcode,
#"Content-Type" = "text/plain"
],
RelativePath = "/api/reports/query",
Query = [],
Content = binaryContent
]
)
See if that helps.
Ryder
6 years agoFrequent Visitor
Ok - so when running the code with https the inital error message reads:
DataSource.Error: Web.Contents with the Content option is only supported when connecting anonymously.
Details:
DataSourceKind=Web
DataSourcePath=https://api.ongage.net/api/reports/query
Then when changing the permissions under data source setting to anonymous - the error is as follows:
DataSource.Error: Web.Contents failed to get contents from 'https://api.ongage.net/' (400): Bad Request
Details:
DataSourceKind=Web
DataSourcePath=https://api.ongage.net/
Url=https://api.ongage.net/