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](https://dynamicscommunity101.com/wp-content/uploads/2024/05/Screenshot-2024-05-20-163957.png)
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](https://dynamicscommunity101.com/wp-content/uploads/2024/05/Postman-OData.png)
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](https://dynamicscommunity101.com/wp-content/uploads/2024/05/OData-method-call-sequence.png)
Microsoft reference for the same:
Need help? Connect Atul
- Microsoft Dynamics 365 for finance and operations - September 5, 2024
- Override an existing lookup method event handler - September 2, 2024
- Workflow in Microsoft Dynamics 365 FO - August 22, 2024
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.