Hi, Readers.
Today I would like to briefly summarize the endpoints of the various APIs in Business Central. I sometimes see questions where data is not accessible due to incorrect endpoints in Dynamics 365 Community. For example, API v2.0 VS Web Service (dynamics.com).
So in this post, I simply sorted out the following commonly used APIs:
APIs | Endpoint |
API (v1.0) | https://{businesscentralPrefix}/v2.0/{Tenant id}/{Environment id}/api/v1.0/companies({id})/ |
API (v2.0) | https://{businesscentralPrefix}/v2.0/{Tenant id}/{Environment id}/api/v2.0/companies({id})/ |
API (Beta) | https://{businesscentralPrefix}/v2.0/{Tenant id}/{Environment id}/api/{APIPublisher}/{APIGroup}/beta/companies({id})/ |
custom APIs | https://{businesscentralPrefix}/v2.0/{Tenant id}/{Environment id}/api/{APIPublisher}/{APIGroup}/v2.0/companies({id})/{EntitySetName} |
automation APIs | https://{businesscentralPrefix}/v2.0/{Tenant id}/{Environment id}/api/microsoft/automation/v2.0/companies({id}) |
OData Web Services | https://{businesscentralPrefix}/v2.0/{Tenant id}/{Environment id}/ODataV4/companies({name})/{Service Name} |
Let’s see more details.
API (v1.0)
API (v1.0): With the April 2019 release of Business Central, the standard APIs were released in version 1.0.
Endpoint: https://{businesscentralPrefix}/v2.0/{Tenant id}/{Environment id}/api/v1.0/companies({id})/
For example,
https://api.businesscentral.dynamics.com/v2.0/c8558e71-6ad8-4fcd-9f29-3ca165b41bbe/Sandbox242/api/v1.0/companies(2c6ea79a-9223-ef11-8414-6045bdc8cdaf)/
PS:
1. API (v1.0) for Business Central will be removed in 2026 release wave 1 (BC v28)
2. Transitioning from API v1.0 to API v2.0
API (v2.0)
Endpoint: https://{businesscentralPrefix}/v2.0/{Tenant id}/{Environment id}/api/v2.0/companies({id})/
For example,
https://api.businesscentral.dynamics.com/v2.0/c8558e71-6ad8-4fcd-9f29-3ca165b41bbe/Sandbox242/api/v2.0/companies(2c6ea79a-9223-ef11-8414-6045bdc8cdaf)/
API (Beta)
Beta: The Beta API version has basically been moved to v1.0, but Microsoft has also added new beta apis in recent versions, so if you want to access them, you also need to use them. For example: Business Central 2022 wave 2 (BC21): Use new dedicated APIs for financial reporting (Advanced APIs -> reportsFinance/beta) and customerLedgerEntry resource type (Beta)
Endpoint: https://{businesscentralPrefix}/v2.0/{Tenant id}/{Environment id}/api/{APIPublisher}/{APIGroup}/beta/companies({id})/
For example,
https://api.businesscentral.dynamics.com/v2.0/c8558e71-6ad8-4fcd-9f29-3ca165b41bbe/Sandbox242/api/microsoft/reportsFinance/beta/companies(2c6ea79a-9223-ef11-8414-6045bdc8cdaf)/
https://api.businesscentral.dynamics.com/v2.0/c8558e71-6ad8-4fcd-9f29-3ca165b41bbe/Sandbox242/api/microsoft/reportsFinance/beta/companies(2c6ea79a-9223-ef11-8414-6045bdc8cdaf)/customerLedgerEntries
PS:
1. Moving from Beta to v1.0
custom APIs
custom APIs: Develop a custom API page by using an AL extension and accessing it to retrieve responses and make updates through the API.
For custom APIs, you need to pay attention to the APIPublisher and APIGroup you defined, and the API version number.
Endpoint: https://{businesscentralPrefix}/v2.0/{Tenant id}/{Environment id}/api/{APIPublisher}/{APIGroup}/v2.0/companies({id})/{EntitySetName}
For example,
https://api.businesscentral.dynamics.com/v2.0/c8558e71-6ad8-4fcd-9f29-3ca165b41bbe/Sandbox242/api/zy/zygroup/v2.0/companies(2c6ea79a-9223-ef11-8414-6045bdc8cdaf)/zysalesOrders
automation APIs
automation APIs: Automation APIs provide capability for automating company setup through APIs
Endpoint: https://{businesscentralPrefix}/v2.0/{Tenant id}/{Environment id}/api/microsoft/automation/v2.0/companies({id})
For example,
https://api.businesscentral.dynamics.com/v2.0/c8558e71-6ad8-4fcd-9f29-3ca165b41bbe/Sandbox242/api/microsoft/automation/v2.0/companies(2c6ea79a-9223-ef11-8414-6045bdc8cdaf)
PS: Automation APIs for Dynamics 365 Business Central SaaS
OData Web Services (Not APIs)
OData Web Services: The Open Data Protocol (OData) is a web protocol that is designed for querying tabular data and provides you with an alternative to SOAP-based web services.
Endpoint: https://{businesscentralPrefix}/v2.0/{Tenant id}/{Environment id}/ODataV4/companies({name})/{Service Name}
https://api.businesscentral.dynamics.com/v2.0/c8558e71-6ad8-4fcd-9f29-3ca165b41bbe/Sandbox242/ODataV4/Company('My%20Company')/Customers
PS:
1. Dynamics 365 Business Central: Manage environments via Admin Center API
2. Remove ability to expose a Microsoft page as a SOAP endpoint (removal)
3. Dynamics 365 Business Central: Can we extend standard APIs? – Download Standard Source Code for APIs
END
Hope this will help.
Thanks for reading.
ZHU
コメント