WebApi and FetchXml Length RRS feed

  • Question

  • The WebApi supports FetchXML  and executing predefined queries, see https://msdn.microsoft.com/en-us/library/mt607533.aspx.  This works for small to medium sized FetchXML expressions.  However if you have a query that exceeds the max URL length of a browser after encoding the statement, the FetchXML  that gets posted to the WebApi will be truncated.  I'd like to know if there is a supported way to post FetchXml in the body of a request and get results back.  My initial testing looks like this isn't possible, but I'd like confirmation or suggestions on how to complete such a request.


    https://foo.bar.com/api/data/v8.1/opportunities?fetchxml=#Some Long Complex FetchXml statement#

    Thursday, June 2, 2016 10:29 PM

All replies

  • We tried executing the Fetch XML query with the maximum length (around string with the length 2270), but it worked fine and it gave correct result. Can you send the Fetch XML that you are trying to execute through Web API?




    Inogic | Blog | news@inogic.com

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Saturday, June 4, 2016 11:48 AM
  • We have a web resource that generates the fetchxml and uses the "in" operator that can easily exceed the url limit of 2270. The question I have is there a way to POST to the webapi instead of GET? Or, is there a way to return JSON instead of the bloated XML (SOAP) from the .../web end point? Thanks, David

    Thursday, June 9, 2016 4:28 AM