When Microsoft released Dynamics CRM 2015 Update 1 for CRM Online, it introduced a new API that eases the ability to create applications for Dynamics CRM across a wide set of programming languages, devices and platforms. Web API will help developers to build feature-rich apps on non-Microsoft platforms like iOS, Node.js, etc.

Web API will replace existing Organization Service (SOAP) and Organization Data Service (ODATAv2) end points gradually. Developers should start using CRM 2016 Web API for any form scripts, XMLHttpRequests from web resources or any other Dynamics CRM code that does not run on the server.  Developers should continue using Microsoft Dynamics CRM SDK assemblies for the development of plugin and custom workflows, provided there is no need to support other platforms.

Organization Data Service (ODATA or REST) endpoint has been deprecated with CRM 2016 release. This endpoint was limited to perform CRUD operations only and was never able to support the complex operations supported by Organization Service.

How to enable Web API?

You must have Dynamics CRM 2015 Online Update 1 or higher to enable Web API preview on your Dynamics CRM Instance. Log on to Dynamics CRM instance using System Administrator role.

Go to Settings>Administration and then click on System Settings. Click on Previews tab. Tick the check box I have read and agree to the license terms. Click Ok Button.

enable web api

Verify Web API: Go to Settings -> Customizations and then click on Developer Resources.

Copy Service Root URL under Instance Web API and paste in your browser. The URL will look like this.

https://<your organization name>.api.crm.dynamics.com/api/data/v8.0/

This will list all the entities in your instance in the form of JSON array.

How to use Web API:

You do not need any kind of authentication when you are using Web API inside the CRM application in web resources like JavaScript.

If you are planning to use Web API outside CRM application, for example in Console Application, then you need to register your application with Azure/On- Premise Active Directory first and then authenticate.

We will talk more about this in my next blog post.