OData in Microsoft Dynamics 365 F&O

OData stands for Open Data protocol is a standard way for creating and consuming APIs. It allows for the easy exposing and updating of data through web technologies, making it straightforward to access Dynamics 365 F&O data from external systems.

OData provides real-time access to Dynamics 365 F&O data, which is essential for timely decision-making and reporting to end users. In Dynamics 365 F&O, you can expose data through OData by creating data entities. External applications can consume these OData services using standard web protocols (HTTP requests), allowing them to read or write data and also Supports querying using standard URL conventions so we can filter, sort, and manipulate data directly through the URL.

One example of OData is shown below, here first I will get an access token using Bearer token authorization as shown in the picture below.

Postman authorisation Dynamics 365 FO
Postman authorisation Dynamics 365 FO

Once the token is generated, now we will hit the OData URL for Dynamics 365 F&O to fetch one Purchase order using PurchaseOrderHeadersV2 Data Entity.

Postman OData
Postman OData

As shown in the picture above we have called PurchaseOrderHeadersV2 and applied a filter of Purchase order and Data area ID.

Order in which method is called in Odata:

OData method call sequence
OData method call sequence

Microsoft reference for the same:

Open Data Protocol (OData)

Need help? Connect Atul

Atul Yadav

2 Comments

  1. Matthew M.

    Excellent example and easy to follow. This is EXACTLY what I have been trying to do for a month and is exactly HOW I have been trying.

    When I follow these same steps, I get the message “Resource not found.” I can do it successfully on other entities, like accounts. It is my understanding that any entity that has its IsPrivate flag set to TRUE will return this message. Furthermore, I have read that you cannot change this flag. Rock, meet hard place.

    So, PLEASE tell me how you got this to return data on an entity that is flagged IsPrivate. Once I know this I might start growing back the hair that I have pulled out.

    • Hi @Matthew,

      Thank you for your kind words. This entity is standard and its IsPublic property is set to Yes by default. I agree that we can’t change it for standard entities. If you’re facing this issue, I believe you need to create a custom data entity.

Leave a Reply

Your email address will not be published. Required fields are marked *