Introduction to the Microsoft Dataverse Web API
Web API vs. the Organization Service
There are two main ways for interacting with data and metadata in Microsoft Dataverse are the Web API and the organization service. You can use the organization service when writing plug-ins or workflow extensions by using the .NET Framework SDK assemblies that are provided by Microsoft.
At the time, of this writing, all data operations go through the underlying organization service. As such, the Web API allows you to perform the same operations as the organization service but in a RESTful style (more information on REST will be provided later in this module).
The following graphic is a decision tree that can help you determine when to use the Web API versus the organization service (through SDK Assemblies) and also when to use XRM Tooling Assemblies (available from Microsoft) for Windows applications.
This module focuses on the Web API; for more information on the organization service, see Use the Dataverse Organization Service documentation found in the Dataverse Developer Guide.
If you'd like to learn more about the XRM Tooling Assemblies that are available for Windows client applications, see Build Windows client applications using the XRM tools documentation, which is also found in the Dataverse Developer Guide. XRM is considered the predecessor to Dataverse, so you'll frequently see this name embedded into documentation and tooling that is provided by Microsoft.
OData 4.0
Dataverse Web API is implemented as an OData (OASIS Open Data Protocol) service. By using an industry standard such as this, you're provided all the benefits of open standard development, such as cross-platform compatibility and simple implementation against a common, predefined protocol.
Dataverse doesn't provide specific .NET assembly tooling for the Web API; instead, we recommend that you use community libraries that conform to the OData protocol. If you want more information about which libraries exist, go to https://www.odata.org/libraries/.
OData provides the ability to interact with Dataverse data with CRUD operations that are available through standard GET, POST, PATCH, and DELETE HTTP methods (more information about these methods will be provided later in this module). You can also perform almost any other operation that is exposed through Dataverse Event Framework by invoking an OData function or action that has the same name as its corresponding organization service message. CRUD-related messages are the only ones that are not available because those messages are achieved with the previously described standard HTTP methods.
REST
Fundamentally, OData protocol is a set of RESTful (REpresentational State Transfer) APIs, a time-tested industry standard for providing interoperability between systems. REST consists of six guiding principles that restrict the way that a service can process and respond to requests to ensure that non-functional properties of that service are met (such as performance, scalability, simplicity, reliability, and so on).
For the purposes of this lesson, you should keep in mind that OData conforms to these constraints and that the Dataverse Web API in turn also conforms to the constraints because it implements the OData 4.0 protocol.
FetchXML
FetchXML is a robust query language that allows for complex querying of Dataverse data. Microsoft provides a way for users to run FetchXML queries within a Web API query. This approach can be valuable if you encounter a scenario where FetchXML is a better fit for your particular query versus using OData query syntax. More information about FetchXML is provided in a later unit in this module.
Trenger du hjelp? Se feilsøkingsveiledningen vår, eller send oss spesifikke tilbakemeldinger ved melde fra om et problem.