Microsoft Dynamics Business Central APIs use OAuth 2.0 for authentication. To establish a connection, you need to perform the following three steps:
1. Register an OAuth App in Azure Active Directory:
Note: Specify the Redirect URL according to documentation and ensure it is used according to callback.
Note: Make sure that the application is given the necessary permissions to work with OAuth in Azure Active Directory.
2. Create an Auth Client on the Platform:
3. Generate a Secret for the OAuth App:
Warning: To maintain a smooth experience, we recommend reusing stored credentials where possible. Duplicating secrets across OAuth clients can result in errors and complications.
1. Client ID
can be found at Application (client) ID
(see picture below)
2. Authorization Endpoint
is equal https://login.microsoftonline.com/{tenantId}/oauth2/authorize?resource=https://api.businesscentral.dynamics.com
, where tenantId
can be found at Directory (tenant) ID
(see picture below)
3. Token Endpoint
is equal https://login.windows.net/{tenantId}/oauth2/token?resource=https://api.businesscentral.dynamics.com
, where tenantId
can be found at Directory (tenant) ID
(see picture below)
4. Client Secret
follow link Certificates & secrets
(see picture below) and use Value
section
During credentials creation you would need to:
OAuth2
drop-down list Type
.Choose Auth Client
or create the new one.For creating Auth Client you should specify following fields:
Field name | Description |
---|---|
Name | your Auth Client’s name |
Client ID | your Application (client) ID |
Client Secret | your Value from Client secrets |
Authorization Endpoint | set: https://login.microsoftonline.com/{tenantId}/oauth2/authorize?resource=https://api.businesscentral.dynamics.com , where tenantId is user domain name |
Token Endpoint | set: https://login.windows.net/{tenantId}/oauth2/token?resource=https://api.businesscentral.dynamics.com , where tenantId is user domain name |
Note!: All of the above fields are mandatory
Name Your Credential
Environment Name
- required, field indicates what environment to be used. How to get a list of business central environments see here. Example: Production
.
Base URL for this component is https://api.businesscentral.dynamics.com/v2.0/${environmentName}/api/v2.0
Authenticate
button - the process would take you to Microsoft Dynamics to log-in and give permissions to the platform to access your service.Verify
button for verifying your credentials.Save
button for saving your credentials.To access the Microsoft Dynamics Business Central Instance URL, follow these steps:
Retrieve all the updated or created objects within a given time range.
Customers
, Sales Orders
, Items
.Emit page
- all found values will be emitted in one array results
, and Emit individually
- each found object will be emitted individual.There is no input metadata.
Depends on Object Type
and Emit behavior
fields. If Emit behavior
field is equal to Emit page
- object with property results
that contains array of selected objects will be returned, if to Emit individually
, metadata for selected Object Type
will be returned.
Delete an object by a selected field that uniquely identifies it.
Customers
, Sales Orders
, Items
.Delete Criteria
configuration field.The id of the object deleted.
Lookup a single object by a selected field that uniquely identifies it.
Customers
.Lookup Criteria Value
becomes optional.Allow criteria to be omitted
is selected): Value for unique search criteria in Lookup Criteria
configuration field.Object with result of lookup as value.
Lookup a set of object by defined criteria list. Can be emitted in different way.
Customers
, Sales Orders
, Items
.Emit all
, Emit page
or Emit individually
.Filter Expression
. For advanced users. Otherwise, enter your search criteria in the appropriate metadata field.Expert Mode for Filter Expression
checkbox is disabled).If configuration field Expert Mode for Filter Expression
is enabled:
Filter Expression
(without $filter=
). For advanced users. Example: Entry_No gt 610 and Entry_No lt 615
.If configuration field Expert Mode for Filter Expression
is disabled:
Depend on configuration field Number of search terms
. If = N
- N search term and N-1 logical operators will be generated, if = 0 - any search term will be generated.
Example for Number of search terms = 2
:
{
"sTerm_1": {
"fieldName": "id",
"condition": "eq",
"fieldValue": "1"
},
"link_1_2": "and",
"sTerm_2": {
"fieldName": "displayName",
"condition": "contains",
"fieldValue": "Cronus"
}
}
If selected Emit Behavior
is Emit page
additionally fields will be added:
totalCountOfMatchingResults
wil be returned.For Emit All
mode: An object, with key results
that has an array as its value.
For Emit Page
mode: An object with key results
that has an array as its value (if Page Size
> 0). Key totalCountOfMatchingResults
which contains the total number of results (not just on the page) which match the search criteria (if Page Size
= 0).
For Emit Individually
mode: Each object which fill the entire message.
Updates (if record found) or creates a new object.
Customers
, Sales Orders
, Items
.Upsert Schema
.Result object from upsert.
Executes custom request.
false
.GET
, POST
, PUT
, PATCH
, DELETE
.Example of Input Metadata for PATCH request: