Work with different OData return documents

Completed

When you register an OData web service, you expose an OData service that can be accessed from a URI by using a web browser or any other HTTP client. Business Central supports OData version 4.

JSON documents

OData version 4 will return JSON documents.

https://api.businesscentral.dynamics.com/v2.0/\<tenant\>/ODataV4/\<service\>

Service metadata (EDMX) documents

The Entity Data Model (EDM) is a specification for defining the data that is used by applications that are built on the Entity Framework. EDMX is an XML-based file format that is the packaging format for the service metadata of a data service.

The following guidelines have been implemented for EDM:

  • Business Central field names are mapped to EDMX property names by replacing spaces with underscores.

  • Primary key fields in tables are automatically defined as properties in the service metadata document, even if they aren't exposed on a page as controls.

You can obtain service metadata documents for either page or query web services.

https://api.businesscentral.dynamics.com/v2.0/\<tenant\>/ODataV4/$metadata

An EDM document holds information about the different data types in the OData web services. You can find the used primary keys (and the length for the fields), and if they're mandatory.