Starting Microsoft Dynamics CRM API (JavaScript)

You can enhance Microsoft Dynamics CRM user-experiences by accessing their API. In this example, JavaScript was used to access the API.


After logging in your instance, on the Ribbon, click Settings and then click Customizations.

Click the Customizations button in the Ribbon.

In the Customizations page, click Developer Resources.

Click the Developer Resource link.

Once you are in the Developer Resources page, look for a section called Instance Web API.

Developer Resources page.

Sample URL

With the Instance Web API, you can call a certain entity type, for example:

Case Entity

Task Entity

Annotations/Notes Entity

View all other entities

The API returns the list of entities.

Sample JavaScript Source Code

You can place the JavaScript in the Web Resource file or use the browser debugger (you must be in CRM and on your keyboard, press F12).

var get_client_url = parent.Xrm.Page.context.getClientUrl();
var req = new XMLHttpRequest();"GET", get_client_url + "/api/data/v9.1/tasks", false);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
var result = JSON.parse(req.responseText);


​Microsoft. (2019, March 21). Web API Reference. Retrieved from Microsoft Docs: 

Leave a Reply