Overview
Configuration is provided for establishing connections with Dynamics 365 Business Central service. The configuration is used in the REST Connection Manager.
Setup
Press icon to get more information about the connection parameters.
Obtain data
Use REST Source component to get data from service resource.
Insert data
Use REST Destination component to insert data into service resource.
Quick Start
In this task, we will show you step-by-step how to create a OAUTH connection to Dynamics 365 Business Central REST API using COZYROC's REST Connection Manager.
Congratulations! You have now established a connection to your Dynamic Business Central instance.
In this task, we will show you step-by-step how to create a Basic Auth connection to Dynamics Business Central REST API using COZYROC's REST Connection Manager.
Step 2. From drop-down menu Configuration select **Dynamics Business Central **. Set [tenantId] to the desired tenant and [environment] to the desired environment in the Server host parameter. In the grid below provide values for the parameter Username, AccessKey and Company
. For company parameter specify value in format Company('[id]')
Congratulations! You have now established a connection to your Dynamic Business Central instance.
In this guide, we will show how to read data from the Dynamic 365 Business Central service resource using the COZYROC REST Source component.
In this guide, we will show how to write data to the Dynamic 365 Business Central service resource using the COZYROC REST Destination component.
Step 4. Click on the "Mapping" tab and map the input columns for the process you are configuring.
If you want to provide input for other resource composite objects, change the input above and map the columns.
Done. You have now learned how to write data into the Dynamic 365 Business Central resource.
Configuration
Base URL address: https://api.businesscentral.dynamics.com/v2.0/[tenant]/[environment]/api/v2.0
.
- OAuth
-
The authentication uses an authorized token. The token will be refreshed with the following expression:
{{=Date.now() + (response.expires_in - 300) * 1000}}
.The authentication has the following user-defined parameters:
- client_id: Required. Identifier of application that is associated with the authentication token.
- client_secret: Specify application client secret. Optional.
- Tenant: Required. Specify tenant identifier.
- Company: Required. Specify company identifier.
The following request parameters will be automatically processed during the authentication process:
-
Authorization:
Bearer {{=token.Access}}
Documentation: https://docs.microsoft.com/en-us/graph/auth-v2-user.
- Basic
-
The authentication uses a parameters-based authentication.
The authentication has the following user-defined parameters:
- Username: Required. Specify user name.
- AccessKey: Required. Specify access key.
- Company: Required. Specify company identifier.
The following request parameters will be automatically processed during the authentication process:
-
Authorization:
Basic {{=Base64.encode(connection.user.Username + ':' + connection.user.AccessKey)}}
Based on resource template Base.
- [Read] action
-
Endpoint URL address:
/companies
.
The result is extracted from:{{=response.value}}
.
- [Read Single] action
-
Endpoint URL address:
/companies/{{=parameters.company}}
.
The result is extracted from:{{=response.value}}
.The action has the following user-defined parameters:
- company: Required. Specify the company identifier.
- id
Template: ShortText.
- systemVersion
Template: ShortText.
- name
Template: ShortText.
- displayName
Template: ShortText.
- businessProfileId
Template: ShortText.
- systemCreatedAt
Template: DateTime. A read-only field.
- systemCreatedBy
Template: ShortText. A read-only field.
- systemModifiedAt
Template: DateTime. A read-only field.
- systemModifiedBy
Template: ShortText. A read-only field.
- [Read] action
-
The external resource list URL address: {{=connection.serverHost}}/
.
The external resource list is extracted from: {{=response.value}}
.
Based on resource template Entity.
- [Read] action
-
The result is paginated.The following request parameters will be automatically processed:
-
$select:
{{=_.without(parameters.fields, '@odata.etag', 'entityName', 'etag').join()}}
-
$skiptoken:
{{=parameters.iterator}}
-
Prefer:
odata.include-annotations, odata.maxpagesize={{=parameters.batchSize}}
-
_includeUserParameters:
{{=parameters}}
-
$select:
- [Create] action
-
The action uses POST method.The following request parameters will be automatically processed:
-
_includeUserParameters:
{{=parameters}}
-
application/json:
{{=item}}
-
_includeUserParameters:
- [Update] action
-
The action uses PATCH method.The following request parameters will be automatically processed:
-
_includeUserParameters:
{{=parameters}}
-
application/json:
{{=item}}
-
_includeUserParameters:
- [Delete] action
-
The action uses DELETE method.
Based on resource template Base.
- [Read] action
-
Endpoint URL address:
/companies({{=BusinessCentral.getCompany()}})/{{=resource.external.name}}
.
The result is extracted from:{{=response.value}}
.
- [Read Single] action
-
Endpoint URL address:
/{{=resource.external.name}}({{=parameters.id}})
.
The result is extracted from:{{=[response]}}
.The action has the following user-defined parameters:
- id: Required. Specify the entity identifier.
- [Create] action
-
Endpoint URL address:
/$batch
.
The result is extracted from:{{=BusinessCentral.getError(resource, batch, response.responses)}}
.The action has the following user-defined parameters:
- parentId: Optional. Specify the parentId only if creating the child record.
- childResource: Specify the childResource for which to perform the create action.
The following request parameters will be automatically processed:
-
Prefer:
odata.continue-on-error
-
application/json:
{{=BusinessCentral.executeAction(resource, batch, 'create', parameters)}}
Documentation: https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/create-entity-web-api.
- [Update] action
-
Endpoint URL address:
/$batch
.
The result is extracted from:{{=BusinessCentral.getError(resource, batch, response.responses)}}
.The action has the following user-defined parameters:
- parentId: Optional. Specify the parentId only if updating the child record.
- childResource: Specify the childResource for which to perform the update action.
The following request parameters will be automatically processed:
-
Prefer:
odata.continue-on-error
-
application/json:
{{=BusinessCentral.executeAction(resource, batch, 'update', parameters)}}
Documentation: https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/create-entity-web-api.
- [Delete] action
-
Endpoint URL address:
/{{=resource.external.name}}({{=item[resource.keyField]}})
.
- @odata.etag
Template: ShortText.
- [External]
-
The external fields list is extracted from:
{{=BusinessCentral.getEntityFields(resource)}}
.
- ShortText
Data type: DT_WSTR ( length 255 )
- LongText
Data type: DT_WSTR ( length 1000 )
- DateTime
Data type: DT_DBTIMESTAMP
- Double
Data type: DT_R8
- Boolean
Data type: DT_BOOL
- BigInt
Data type: DT_I8
- Integer
Data type: DT_I4
- Money
Data type: DT_CY
- Uniqueidentifier
Data type: DT_GUID
- Decimal
Data type: DT_DECIMAL
- Date
Data type: DT_DBDATE Before setting, the value is processed with
{{=dateFormat(value, 'yyyy-mm-dd')}}
expression.- Image
Data type: DT_IMAGE
What's New
- New: Metadata loading performance improvement.
- Fixed: Unable to update or delete entities where multiple keys are required.
- Fixed: Failed with error "undefined cannot be converted to an object" when trying to Create/Update entity records (Thank you, Abdelhadi).
- New: Support for navigation properties.
- New: Introduced connection.
COZYROC SSIS+ Components Suite is free for testing in your development environment.
A licensed version can be deployed on-premises, on Azure-SSIS IR and on COZYROC Cloud.