What type of API does Microsoft Dynamics 365 ERP provide?
The primary API types supported by Microsoft Dynamics 365 ERP are:
-
REST API (Web API)
- The Web API is a REST-based API for accessing Dynamics 365 web services.
- It is based on the OData 4 standard.
- It was introduced with Dynamics 365 (version 8.0).
- It is intended to replace the older SOAP-based endpoint.
-
SOAP API (Deprecated)
- Dynamics 365 previously supported a SOAP-based API, known as the CRM 2011 endpoint or SOAP endpoint.
- This API has been deprecated since Microsoft Dynamics CRM Online 2016 Update 1 and Microsoft Dynamics CRM 2016 Service Pack 1 (8.1.0).
-
OData Web Services
- Business Central, which is part of the Dynamics 365 suite, supports OData web services in addition to the REST API.
- OData is based on the OData version 4 standard and is well-suited for web service applications that require a uniform, flexible, general-purpose interface for exposing CRUD operations.
Best practices:
- Use the Web API (REST) for new development and integrations.
- Update existing applications to use the Dynamics 365 Web API instead of the deprecated SOAP endpoint.
- For Business Central specifically, the REST API is optimized for performance and is the preferred way to integrate with external systems.
Does the Microsoft Dynamics 365 ERP API have webhooks?
Availability of Webhooks
Yes, Microsoft Dynamics 365 does support webhooks for receiving event notifications.
Types of Events
You can subscribe to various types of events in Dynamics 365 using webhooks, including:
- Create, update, and delete operations on entities/tables
- Specific operations like updating a contact
- Custom API events
Key Features
- Webhooks allow sending data about events that occur on the server to external web applications
- They use a lightweight HTTP pattern with a publish/subscribe model
- Webhook senders notify receivers about events by making requests to receiver endpoints with event information
Advantages
- Simpler authentication compared to Azure Service Bus (can use HTTP headers or query parameters)
- Supports both synchronous and asynchronous steps (Azure Service Bus only supports asynchronous)
- Can be consumed by any programming language or web application hosted anywhere
- Can be invoked from plugins or custom workflow activities
Considerations
- Azure Service Bus may be better for high-scale processing as it provides full queueing
- Webhooks can only scale to the point where your hosted web service can handle the messages
Implementation
- You need to register a webhook and configure a service to consume the webhook requests
- Authentication options include HTTP headers, webhook keys, or query string parameters
- Webhook notifications are sent as POST requests with JSON payloads
Testing and Debugging
- You can use request logging sites like RequestBin to test webhook registrations before implementing your own service
In summary, Microsoft Dynamics 365 offers robust webhook support for receiving real-time event notifications, allowing developers to integrate external services and custom code with Dynamics 365 data and events.
Rate Limits and other limitations
Here are the key points about API rate limits for Microsoft Dynamics 365 ERP API:
General Limits
-
Resource-based service protection API limits are enabled in finance and operations apps environments as of version 10.0.19 [2].
-
These limits are designed to protect the service when client applications make extraordinary demands on server resources [2].
-
The limits are enforced based on environment resource utilization thresholds, throttling requests when aggregate consumption of web server resources reaches levels that threaten performance and availability [2].
User-Based Limits
Exceptions
- Certain services are exempt from the limits, including:
- Document Routing Agent
- Warehouse Management mobile app
- Retail Server API
- Office Integration
- Data Import/Export Framework
- Recurring integrations
- Data Integrator
- Power Platform virtual tables (when integration is enabled)
- Finance and operations apps Connector [2]
Other Considerations
-
Limits are enforced per web server in the environment [2].
-
The limits shouldn't affect regular users of interactive clients, only applications performing extraordinary API requests [2].
-
Limits apply only to finance and operations online service environments, not on-premises or development environments [2].
Best Practices
-
For applications that may hit limits, consider:
- Decreasing the total number of records that can be selected in a list
- Combining selected operations into batches [2]
-
Monitor API usage to track potential throttling issues [2].
It's important to note that these limits are subject to change, and Microsoft continuously reviews and updates them based on service performance and customer feedback.
Latest API Version
Based on the search results provided, here is the most up-to-date information about the Microsoft Dynamics 365 ERP API versions:
Latest Version
The most recent version of the Microsoft Dynamics 365 ERP API appears to be version 10.0.40. This version has the following details:
- Build number: 10.0.1935.5
- Preview release: April 2024
- General availability (self-update): May 2024
- General availability (auto-update): June 2024
Key Points
-
Version numbering: Microsoft Dynamics 365 Finance uses a version numbering system like 10.0.x, with the latest being 10.0.40.
-
Regular updates: Microsoft releases new versions frequently, with the previous version being 10.0.39.
-
Platform updates: Each version includes platform updates for finance and operations apps.
-
Preview and release schedule: New versions typically have a preview release, followed by general availability for self-update, and then auto-update.
-
Release plans: Microsoft provides detailed release plans for upcoming features and capabilities.
Best Practices
-
Stay informed: Keep track of the latest releases and their features through Microsoft's documentation and release plans.
-
Plan for updates: Be aware of the preview and general availability dates to plan for testing and implementation.
-
Review deprecated features: Check the "Removed or deprecated features" documentation before updating to ensure compatibility.
-
Access bug fixes: Sign in to Microsoft Dynamics Lifecycle Services to view detailed information about bug fixes included in each update.
-
Version-specific development: When developing against the API, use the version number that was current when your code was written, and test thoroughly before moving to newer versions.
It's important to note that while 10.0.40 is the latest announced version, always check the official Microsoft documentation for the most up-to-date information, as new versions may be released regularly.
How to get a Microsoft Dynamics 365 ERP developer account and API Keys?
To get a developer account for Microsoft Dynamics 365 ERP and create an API integration, you need to follow these steps:
Sign up for a Microsoft Developer Program
- Request access to the Microsoft developer program and get a developer account by visiting the Microsoft Developer Program website.
Create an OAuth Application
- Follow Microsoft's guide to create an application registration and obtain an Application (client) ID.
- Set the Redirect URI to
https://api.integration.app/oauth-callback
.
- Generate a client secret:
- Go to the "Certificates & secrets" section
- Select "New client secret"
- Save the generated secret securely for later use.
Set up Microsoft Entra ID (formerly Azure Active Directory) Authentication
- Sign in to the Azure portal.
- Register Dynamics 365 Business Central as an app to provide access for users in the directory.
- On the "API permissions" page for your app:
- Select "Add a permission"
- Choose the "Microsoft APIs" tab
- Select "Dynamics 365 Business Central"
- Select "Delegated permissions"
- Ensure the "Financials.ReadWrite.All" permission is checked
- Choose "Add permissions"
Using the OAuth Application
- Implement the OAuth authorization flow, which involves redirecting users to the Microsoft authorization endpoint and obtaining an access token.
- Refer to the Microsoft API documentation for detailed instructions on implementing the OAuth flow and making API requests.
Best Practices
- Keep your Client Secret secure and never expose it publicly.
- Use Microsoft Entra ID/OAuth v2 authentication for production environments.
- Explore the APIs through the OpenAPI specification for Business Central.
- For inspiration and examples, check the open-source ALAppExtensions repo for API pages written in AL.
What can you do with the Microsoft Dynamics 365 ERP API?
Based on the search results provided, here is a list of data models that can be interacted with using the Microsoft Dynamics 365 ERP API, along with what is possible for each:
Data Entities
- Data entities provide conceptual abstraction and encapsulation of underlying table schemas [4].
- They represent common data concepts and functionalities like Customers or Vendors [4].
- Possible interactions:
- CRUD operations (Create, Retrieve, Update, Delete) through OData REST endpoint [5]
- Can be used for Excel Add-ins, import/export, or integration [4]
- Can be included in data packages for migration or configuration [4]
Data Packages
- A compressed file containing a data project manifest and data files [4].
- Possible interactions:
- Can be used for import or export of multiple files with the manifest [4]
- Useful for data migration, copying configurations between companies/environments [4]
- Can be sequenced and named for easy identification during import/export [4]
Master Data
- One of the four categories of physical data in the enterprise [2].
- Possible interactions:
- Can be migrated from legacy or external systems [4]
- Can be managed and synchronized across applications [2]
Configuration Data
- Another category of physical data in the enterprise [2].
- Possible interactions:
- Can be copied between companies/environments [4]
- Used to configure processes or modules [4]
Transactional Data
- A category of physical data representing business events [2].
- Possible interactions:
- Can be imported/exported using data entities [4]
- Can be integrated in real-time or asynchronously [4]
Inferred Data
- A category of physical data derived from other data [2].
- Possible interactions:
- Can be generated through data analysis and processing [2]
OData Services
- Exposes all data entities marked as
IsPublic
in the Application Object Tree (AOT) [5].
- Possible interactions:
- Complete CRUD functionality [5]
- Supports query options like $filter, $count, $orderby, $skip, $top, $expand, and $select [5]
- Allows adding custom actions to entities [5]
Enums
- Can be included in OData queries using specific syntax [5].
- Possible interactions:
- Can be used in filtering and querying data [5]
Data Projects and Jobs
- Data projects contain configured data entities with mapping and processing options [4].
- Data jobs are execution instances of data projects [4].
- Possible interactions:
- Can be created and managed for data import/export operations [4]
- Can be scheduled and tracked through job history [4]
This list covers the main data models and interactions possible with the Microsoft Dynamics 365 ERP API based on the provided search results. Each model offers various capabilities for data management, integration, and manipulation within the Dynamics 365 ecosystem.