Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
You can use the Web API or SDK for .NET to work with data, as well as table and column definitions in Dataverse.
The Dataverse Web API provides a development experience that can be used across a wide variety of programming languages, platforms, and devices. The Web API implements the OData (Open Data Protocol), version 4.0, an OASIS standard for building and consuming RESTful APIs over rich data sources. You can learn more about this protocol at https://www.odata.org/. Details about this OASIS standard are available at https://www.oasis-open.org/standards#odatav4.0.
Because the Web API is built on open standards, we don't provide assemblies for a specific developer experience. You can compose HTTP requests for specific operations or use third-party libraries to generate classes for whatever language or platform you want. You can find a list of libraries that support OData version 4.0 at https://www.odata.org/libraries/.
Web API and the Organization service
It's valuable to recognize that the organization service is what defines the platform. The Web API provides a RESTful programming experience but ultimately all data operations go through the underlying organization service. The organization service defines the supported operations as messages. Each message has a name. These names are bound to the events used in the event framework to evaluate what registered extensions should be initiated. More information: Event Framework
The Web API allows you to do the same operations as the SDK for .NET but presents them in an RESTful style. OData v4 provides for named operations via functions or actions. Most messages available in the organization service are exposed as a corresponding named function or action. Those messages that correspond to CRUD operations aren't available in the Web API because as a RESTful service they have implementations using GET
, POST
, PATCH
, and DELETE
HTTP methods, but within the platform the retrieve, create, update, and delete messages are invoked in the same way the corresponding operations are performed using the SDK for .NET assemblies.
Getting started
You can use the Web API with any language that allows you to send authenticated HTTP requests. We prepared a few getting started experiences for four common scenarios:
HTTP request tools
An application that allows you to compose and send authenticated HTTP requests is an essential first step. There are many available, such as Postman, Bruno, or curl. Choose and use whichever you like best. We provide some steps to use Insomnia because it has a graphic user interface, a relatively easy installation, and provides an option to opt out of creating an account. Learn how to use Insomnia with Dataverse Web API
Tip
Unless you already have a favorite HTTP request tool, you might find that using PowerShell with Visual Studio Code is as easy to get started and allows for powerful scripting capabilities as well.
PowerShell developers
Using Web API with PowerShell is one of the easiest ways to get started. You can use the Invoke-RestMethod cmdlet to send requests and process the responses using the ConvertTo-Json cmdlet.
You can find the following content about using PowerShell with Web API:
- Quick Start Web API with PowerShell and Visual Studio Code
- Use PowerShell and Visual Studio Code with the Dataverse Web API
- Web API Data operations Samples (PowerShell)
JavaScript developers
JavaScript developers frequently use the Dataverse Web API with model-driven apps. Model-driven apps provide the Xrm.WebApi object that exposes methods to interact with the Web API. Learn more about client-side JavaScript using Web API in model-driven apps.
Single Page Applications (SPAs) also use JavaScript and can connect to the Dataverse Web API. Quickstart: Web API with client-side JavaScript and Visual Studio Code describes how to connect to the Web API using a SPA application pattern. You can find more samples in Web API Data operations Samples (Client-side JavaScript).
Within Power Apps Component Framework (PCF) components, JavaScript developers use methods that are part of the WebAPI object to work with Dataverse data in PCF components.
Finally, Power Pages exposes a Portals Web API that offers a subset of Dataverse operations available using the Web API.
.NET developers
.NET developers can use either the Dataverse SDK for .NET or the Web API. You might want to use the Web API when you don't want to take a dependency on a specific NuGet package or the requirements of your project don't require the strongly-typed classes provided by the SDK for .NET.
To use Web API with C#, see these quick start articles:
There are many more C# Web API samples in Web API Data operations Samples (C#)
Related Sections
Work with data using code
OData - the best way to REST
OData Version 4.0 Part 1: Protocol Plus Errata 02
OData Version 4.0 Part 2: URL Conventions Plus Errata 02
OData Version 4.0 Part 3: Common Schema Definition Language (CSDL) Plus Errata 02