PL 400 : interact with data and processes by using the Dataverse Web API or the Organization Service (Use platform APIs)

API is not a new concept, but in the modern computer world, it is the popular way of communication between applications. An API is a component that allows different platforms, applications, and systems to connect and share information with each other. Developers use this component to improve their products/software by accessing other business data, software, services or code. Most of the benefits of an API are that it is easy to use in code and allows access to resources with control manners.


Web API is basically an Open-Source framework that is used to write HTTP APIs.

In the Dataverse, Microsoft provides different mechanisms to work with data, tables and column definition. Those are below:

  • Web API
  • Organization Service

Microsoft first introduced this feature in Dynamics CRM 2016 and it uses similarly in the Dataverse  with different programming languages, multiple platforms, and devices. The Web API in Dataverse uses the Open Data Protocol (OData), known as OData version 4.0. OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs.  OData helps to focus on business logic while building RESTFUL APIs without having to worry about the various approaches to define:

  • Request & Response header
  • Status Codes
  • HTTP Methods
  • URL 
  • Media Types
  • Payload format
  • Query options
OData RESTFUL APIs are easy to consume.
Because Web API is based on REST, we can use it with HTTP in JavaScript or C# with .NET or any other platform or programming language. It can be called and accessed using JavaScript. We can use Web API with HTML web resources, form scripts, and ribbon commands to perform various  operations on data. Web API is very convenient to use with JavaScript as it returns in the form of JSON objects that can be easily converted to JavaScript objects.

Following are the features of Web API: 
  • It implements OData version 4.0 for creating and consuming RESTful APIs on rich data sources like DOC, HTML and PDF. 
  • It supports a variety of programming languages such as .NET, C++, Java, Python. , device and platform
  •  requests and responses have JSON format
Some of the CRUD operations that Web API provides are:
  • Create
  • Update
  • Delete
  • Retrieve
  • Retrievemultiple (Using  OData and Fetch)
  • Execute Web API functions
  • Execute Web API Actions
  • Execute Web API Query functions
Limitation of Web API :
  • A maximum of 5000 records will be returned for each request.
  • If there are more records that match the query filter criteria a @odata.nextlink property with returned with the results
  • Web API is not enabled for MS dynamics outlook with offline access while user is offline.
  • Can't retrieve unpublished metadata.
  • Error when querying self referential Many to Many relationships.
  • Null Valued properties may not be returned in expanded navigation property results.
Dataverse Organization Service:

Dataverse Organization service is another option to interact and process the data. The organization service is optimized for use with the .NET Framework and the SDK assemblies in the Microsoft.CRMSdk.CoreAssemblies NuGet package provide the classes for the IOrganizationService interface necessary work with data, and table and column definition using this service. The organization service defines the supported operations as messages. Each message has a name. These messages correspond to the events that are emitted by the event framework. The .NET assemblies for the organization service currently use a SOAP endpoint. The assemblies were designed to closely model the underlying platform services based on IOrganizationService interface. However they are not the same components and should not be confused with one another. The SOAP endpoint for the organization service was introduced in 2011 and we have announced that it is deprecated.

Key features:
  • For use of Organization service, we should implement the IOrganizationService interface.
  • It is also known as SOAP endpoint.
  • It is the primary web service for accessing data and metadata from Microsoft Dynamics CRM organization.
  • Organization service request and response is in SOAP format.
  • The Microsoft Dynamics CRM SDK provides assemblies and tools to generate strongly typed classes and proxies to simplify development in Microsoft Visual Studio.
  • Up to 5000 records can be returned in a single query.

Comments

Popular posts from this blog

PCF vs. Web Resources: Choosing the Right Extensibility Tool for Dataverse

Is Debt Prosperity or Trap?

Exam PL-400: Microsoft Power Platform Developer