topic hubIntegration & APIsofficial - Microsoftreviewed - checked by Opus

Connect apps

Connect apps covers building point-to-point integrations between Business Central and partner solutions through REST APIs. It answers questions on developing API pages and queries, authentication (OAuth 2.0, service-to-service), OData filters, batch requests and request headers.

Path: Integration > Connect apps · tier official · system integration · narrative reviewed (checked by Opus)

Overview

Connect apps is about building integrations that link Business Central to external partner solutions using REST APIs. The section starts with a getting-started page that explains authentication setup, exploring the APIs with Insomnia, and calling endpoints.

For developers who need their own endpoints, two pages cover custom APIs: one compares API pages (read-write) with API queries (read-only joined datasets), and the other walks through creating API pages in AL, including relationships and moving away from the deprecated ODataEDMType complex types.

The remaining pages support day-to-day API use: filter expressions in OData calls, tips on GET requests, language headers, batch requests and data access intent, and service-to-service authentication for unattended integrations. Start with the getting-started page, then pick the page that matches your task.

Key points

  • Connect apps create point-to-point connections between Business Central and partner solutions using REST APIs.
  • Authentication options include Microsoft Entra ID with OAuth 2.0, basic authentication with a web service access key, and service-to-service authentication.
  • Service-to-service authentication uses the OAuth 2.0 client credentials flow for unattended integrations, with API.ReadWrite.All and Automation.ReadWrite.All permissions and Microsoft Entra registration.
  • API pages give read-write operations; API queries give read-only joined datasets. Both expose OData v4 endpoints, and webhooks are supported.
  • Custom API pages in AL need APIVersion, APIPublisher and APIGroup, and use properties such as ODataKeyFields, SystemId, EntityName, EntityCaption and EntitySetCaption (API v2.0).
  • Relationships are handled with parts and navigation properties; the ODataEDMType complex types are deprecated.
  • Tips cover Accept-Language for localization, transactional OData $batch with Isolation: snapshot, and the Data-Access-Intent header with ReadOnly intent (from version 17.1).
  • Filtering follows Microsoft REST API guidelines for property-based and range-based filter expressions.

Learn pages

  • Develop APIs with Pages and Queries: Learn how to develop custom Business Central APIs with API pages and API queries, and find guidance for performance and troubleshooting.
  • Developing a custom API: Learn how to develop a custom API page by using an AL extension and accessing it to retrieve responses and make updates through the API.
  • Get started developing Connect apps for Dynamics 365 Business Central: Learn how to develop a Connect app for Business Central, including setting up Microsoft Entra authentication and exploring REST APIs with Insomnia.
  • Tips for working with the APIs: Provides some tips about working with Business Central API.
  • Using filters with API/OData calls: Learn how to use filters with API calls to get targeted information in return.
  • Using Service to Service Authentication: Service-to-service authentication enables external services to connect as an application, without impersonating normal users.
    • Status: S2S authentication generally available for Business Central automation APIs online version 17.0 and on-premises versions 18.11 and 19.5 and later.
    • Status: S2S authentication generally available for Business Central APIs v1.0 and v2.0 online version 18.3 and on-premises versions 18.11 and 19.5 and later.
    • Service-to-service authentication uses OAuth 2.0 Client Credentials flow for integrations running without user interaction; supports scheduled tasks on version 21.2 and later.
    • Step: Register Microsoft Entra application with unique name, specify supported account types, optionally add redirect URI for OAuthLanding.htm file.
    • Step: Create client secret for registered application by selecting Certificates and secrets, New client secret, adding description, selecting duration, selecting Add.
    • Step: Grant API.ReadWrite.All and Automation.ReadWrite.All permissions to Dynamics 365 Business Central API via API permissions, Add a permission, Microsoft APIs.
    • Step: Set up Microsoft Entra application in Business Central by searching Microsoft Entra applications, selecting New, entering Client ID, Description, setting State to Enabled, assigning permissions.
    • Limit: Applications cannot be assigned SUPER permission set; use least-privilege principle and assign only required permissions for integration.

Key facts from Microsoft Learn (CC BY 4.0), in our own words (D106); open the page for the full text.

Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.

What Learn documents here 6 Learn pages