Following JavaScript shows how to retrieve record(s) from Dynamics CRM using FetchXml and Web Api.
Note: Make sure that you have right version of WebApi in your code.