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
Anonymous
1 year agoNot applicable
Hi, markvanwyk
Perhaps you can build the following query, create a Blank Query in PowerQuery, and go to the Advanced Editor
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
Response
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
markvanwyk
1 year agoRegular Visitor
Hi
Thnaks for the info - we did try the solution but get the below error
- lbendlin1 year agoSuper User
instead of \" use ""
- markvanwyk1 year agoRegular Visitor
Hi Ibendlin
Thanks for the sugestion but still doesnt work. I have tried multiple option
<Criteria field="tagName" operator="EQUALS">Cloud Agent</Criteria><Criteria field=\'tagName\' operator=\'EQUALS\'>Cloud Agent</Criteria><Criteria field='tagName' operator='EQUALS'>Cloud Agent</Criteria><Criteria field="tagName", operator="EQUALS">Cloud Agent</Criteria>Regards
Mark
- lbendlin1 year agoSuper User
<Criteria field=""tagName"" operator=""EQUALS"">Cloud Agent</Criteria>