API Reference

Dynamics 365 Business Central

In this guide, you will find the step-by-step instructions to create the API connection in ERP Dynamics 365 Business Central using the Microsoft Azure Entra service.


API Connection for Business Central

To connect to the API, you need to use a service called ENTRA, which allows login spaces to be opened between your applications. The ENTRA service is a tool for managing identities and access in Microsoft.

  1. Go to https://portal.azure.com/#home
  2. Click on "Manage Microsoft Entra ID" (View)


  1. Go to APP Registration and select New Registration.



  • The user-facing display name for this application (this can be changed later).
  • Select Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant).
  • Enter the desired name for the registration.


Enter the service provider URL for Business Central that each client has:

https://businesscentral.dynamics.com/OAuthLanding.htm



Click the Register button.


  1. Apply API permissions

In the side menu, go to ManageAPI permissions and add a new permission by clicking + Add Permission.



  1. Select the option that indicates Dynamics 365 Business Central.


  1. Select the option that indicates Application permissions.

  1. Scroll down using the right-hand scrollbar and find the option that indicates API.ReadWrite.All (Full Access to web Services API), then select it.

  1. Verify that the permissions have been granted.

  1. Navigate to Certificates & Secrets.

  2. In Client secrets, click New client secret.

    • Description: Enter the desired description name.
    • After the secret is created, copy the information from the Value and Secret ID fields and save it in a text file or notes for future reference.


This is done only once.


  1. Now, go to Dynamics 365 Business Central and use the search option or magnifying glass icon to find what you need.


  1. Type ENTRA in the search field and select the option that indicates Microsoft Entra Applications.

  1. Go to the option that indicates New to create the connection.

  1. You need to register the Client ID.

  1. Go back to Azure, navigate to the Overview section, and copy the Application (client) ID.



  1. Copy it and paste it into Business Central.


  1. Continue the registration. In Description, enter the desired name.
    In State, enable the service.

  1. Select Yes to confirm.

  1. Next, add permissions.

  1. In the selection menu, click the three dots and look for the option that indicates D365 FULL ACCESS.

  1. A continuacion nos dirigimos a Grant consent

  1. Validate with your user credentials and password.

  1. Click the Accept option.


  1. Accep

  1. To test the API, go to https://konvex.readme.io/reference/getting-started-with-konvex.

  1. Navigate to the option that indicates Get invoices List.

  1. Search for the option that says Business Central ERP.

  1. Connection parameters for the query:
    • Client ID
    • Client Secret


  1. You need to fill in the x-environment-id field.

Go to Business Central and select the environment. For example, Sandbox01.


  1. You need to enter this information in the x-environment-id field.

  1. For the x-company-id field, go to Dynamics 365 Business Central and type Companies in the search bar.


It will display the following screen:

  1. A list of companies.
  2. Select the company you want to use.
  3. Copy the Company ID from this list.

Then, enter the Company ID into the x-company-id field.



  1. After that, click the question mark icon in the top right corner of the screen (in black).

  1. Go to Help & Support.


  1. Go to Inspect pages and data.

  1. On the right side, look for Company ID and copy the entry.

  1. Copy the Company ID and run the query.

  1. Try It!