Setup Postman to call D365 F&O Data Entities
·
You’ll need Postman, Tenant ID, Client ID, Client secret value,
and D365 F&O URL environment
Create
Get token request in Postman
- System administration > Setup > Microsoft Entra ID applications
- Click “New” -> Enter APP-ID(client id ), Meaningful name and User ID (the permission you would like to assign).
1.
Create a GET request then enter the URL to be the
following. Replace <Tenant ID> to be your Tenant ID in the Azure Portal.
https://login.microsoftonline.com/<Tenant
ID>/oauth2/v2.0/token
2.
Select Headers tab and specify the following values. Most should
be the default value. However, you will need to set the Host to
login.microsoftonline.com
1.
Click on the Body tab and specify the following key Value pairs
·
Client_id can be found in the App registration
·
Client_secret is the client secret value in the App registration
·
Grant_type should be the test ‘client_credentials’
·
Scope should be the URL instance that you wish to connect to, followed
by the text ‘/.default’
· Click save and send the request
The above access token will be used to authenticate the OData
URLs.
1) Get :D365 URL/Data/Public collection name
by using $expand keyword to include data from the related table and $select to specify the fields to retrieve.
https://usnconeboxax1aos.cloud.onebox.dynamics.com/data/PurchaseOrderHeadersV2?$filter=dataAreaId eq 'USMF'&Cross-company=true&$select=PurchaseOrderNumber,VendorOrderReference&$expand=PurchaseOrderLinesV2 ($select=PurchaseOrderNumber,LineNumber)
reference : https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/odata