Test/Execute your fetchXml with Dyanmics 365 WebAPI
Dynamics 365/CRM WebAPI has unleashed many capabilities to it’s REST endpoint, Executing fetchXml is one of them. Just append entity’s plural name in WebAPI endpoint and pass fetchXml in query string.
Syntax: WebAPI Endpoint + / + Entity Plural Name + ?fetchXml= + Your fetchXml here
https://AshV.crm.dynamics.com/api/data/v8.2/accounts?fetchXml=<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"><entity name="account"></entity></fetch>
I have written AshishVishwakarma.com/FetchXmlTester which makes it very handy so you can easily test fetchXml or generate query to use somewhere else.
You must be logged-in into your Dynamics 365/CRM org in same browser instance. This dosen’t require any credentials, and works for any type of deployment (Online / On-premises / IFD)
To use the same,
- Enter your fetchXml in main big text area.
- It will populate entity plural name, just verify, if not correct change it manually.
- Provide your org URL, not necessary to provide WebAPI endpoint.
- It would generate URL in box beside but. You can click the button to test, which will show JSON response in new tab.
- Alternatively you can copy link generated in box beside button, and open that in new tab.
If you find any bugs or have any suggestion, please update here