Forum Discussion
markvanwyk
1 year agoRegular Visitor
Web API Issue in Power BI Desktop
Hi All I have an issue with the Power BI Web Advanced Query - I can get the API to authneticate and get data from most queries but the below query requires as SericeRequest and I do not know how ...
- 1 year ago
let url = "https://qualysapi.qualys.eu/qps/rest/2.0/search/am/hostasset", headers = [ #"Content-Type" = "text/xml", #"X-Requested-With" = "QualysPostman", #"Authorization" = "xxxxxxxxx" ], body = "<ServiceRequest> <filters> <Criteria field=""tagName"" operator=""EQUALS"">Cloud Agent</Criteria> </filters> </ServiceRequest>", Source = Web.Contents(url, [ Headers = headers, Content = Text.ToBinary(body) ]), Response = Xml.Tables(Source) in ResponseAlternatively you can use the recommended approach - Json.FromValue
lbendlin
1 year agoSuper User
Please follow the documentation. Use the Content parameter to change the request from GET to POST. https://learn.microsoft.com/en-us/powerquery-m/web-contents