Forum Discussion

markvanwyk's avatar
markvanwyk
Regular Visitor
1 year ago
Solved

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 ...
  • lbendlin's avatar
    lbendlin
    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
        Response

     

    Alternatively you can use the recommended approach - Json.FromValue