Integrating Microsoft Dynamics 365 Finance and Operations (D365 FO) OData with Postman
Introduction
Microsoft Dynamics 365 Finance and Operations (D365 FO) provides OData (Open Data Protocol) APIs, allowing developers to interact with D365 FO data programmatically. Using Postman, we can test these APIs for retrieving, creating, updating, and deleting data without writing any code.
This guide will walk you through the process of integrating D365 FO OData APIs with Postman, covering:
- Registering an app in Azure Active Directory (AAD)
- Obtaining an access token
- Making API calls to D365 FO OData endpoints
Step 1: Register an Application in Azure Active Directory (AAD)
Since D365 FO is secured using Azure AD, you must create an Azure AD App Registration to authenticate API requests.
1.1 Register the App
- Go to Azure Portal: https://portal.azure.com
- Navigate to:
Azure Active Directory→App registrations - Click "New Registration"
- Enter a name (e.g., "D365FO_Postman")
- Choose Accounts in this organizational directory only
- Redirect URI: Set it as
https://login.microsoftonline.com/common/oauth2/nativeclient - Click Register
1.2 Get Client Credentials
- Copy the "Application (client) ID"
- Generate a Client Secret:
- Go to
Certificates & secrets - Click
New client secret→ Set expiry → Copy the generated secret
- Go to
1.3 Set API Permissions
- Navigate to "API Permissions"
- Click "Add a Permission" →
APIs my organization uses - Search for Dynamics ERP → Select Delegated Permissions
- Add permissions:
user_impersonation - Click
Grant admin consent
Step 2: Obtain an Access Token in Postman
To interact with D365 FO OData APIs, you need an OAuth 2.0 access token.
2.1 Configure OAuth in Postman
- Open Postman and create a new request
- Go to the Authorization tab
- Select
OAuth 2.0as the type - Click
Get New Access Token - Fill in the details:
- Token Name: D365FO Token
- Grant Type:
Client CredentialsorAuthorization Code - Access Token URL:
https://login.microsoftonline.com/{tenant_id}/oauth2/token - Client ID: Your app's Client ID
- Client Secret: Your app's Client Secret
- Scope:
https://<your-d365fo-instance>/user_impersonation - Audience:
https://<your-d365fo-instance>
- Click Request Token
- Once the token is generated, click Use Token
Step 3: Making OData API Calls in Postman
Once you have an access token, you can start querying D365 FO data using OData endpoints.
3.1 Get a List of Customers
- Method:
GET - URL:
https://<your-d365fo-instance>/data/CustomersV3 - Headers:
Authorization: Bearer {access_token}Content-Type: application/json
3.2 Create a New Customer
- Method:
POST - URL:
https://<your-d365fo-instance>/data/CustomersV3 - Headers:
Authorization: Bearer {access_token}Content-Type: application/json
- Body (JSON):
{
"CustomerAccount": "C0001234",
"Name": "John Doe",
"AddressStreet": "123 Main St",
"City": "Seattle",
"State": "WA",
"ZipCode": "98101"
}
3.3 Update Customer Information
- Method:
PATCH - URL:
https://<your-d365fo-instance>/data/CustomersV3(CustomerAccount='C0001234') - Headers:
Authorization: Bearer {access_token}Content-Type: application/json
- Body (JSON):
{
"Name": "John Doe Updated"
}
3.4 Delete a Customer
- Method:
DELETE - URL:
https://<your-d365fo-instance>/data/CustomersV3(CustomerAccount='C0001234') - Headers:
Authorization: Bearer {access_token}
Conclusion
By following these steps, you can easily integrate D365 FO OData APIs with Postman. This allows you to test API calls, automate processes, and interact with D365 FO data programmatically.
If you encounter issues, check:
- Azure AD Permissions: Ensure your app has the correct
user_impersonationpermissions - Access Token Validity: Regenerate if expired
- Correct OData Endpoint: Verify the URL structure
Happy coding! 🚀