Business Central 2020 wave 1 came up with a lot of features and is enhancing more and more, day by day. Check out the updates here: Business Central 2020 wave 1
One of the features of Business Central 16 is the advancements in APIs. These automated APIs give you the facility such as calling this Automated API and change company setup after the tenant is created. It is placed in microsoft/automation. These APIs work like any other APIs with POST, GET, PATCH requests.
Location of API: https://api.businesscentral.dynamics.com
Some of the examples are as follows:
Automate Company:
----------------------------------------------------------------------------------------------------------------------
POST https://api.businesscentral.dynamics.com/v2.0/{environment name}/api/microsoft/automation/{apiVersion}/companies({companyId})/automationCompanies
Authorization: Bearer {token}
Content-type: application/json
{
"name": "CRONUS",
"displayName": "CRONUS",
"businessProfileId": ""
}
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
GET https://api.businesscentral.dynamics.com/v2.0/{environment name}/api/microsoft/automation/v1.0/companies({id})/automationCompanies
----------------------------------------------------------------------------------------------------------------------
RapidStart Configuration Package:
----------------------------------------------------------------------------------------------------------------------
GET /microsoft/automation/{apiVersion}/companies({companyId})/configurationPackages
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
POST https://api.businesscentral.dynamics.com/v2.0/{environment name}/api/microsoft/automation/{apiVersion}/companies({companyId})/configurationPackages
Authorization: Bearer {token}
Content-type: application/json
{
"code":"{SAMPLE}",
"packageName": "{SAMPLE}"
}
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
PATCH https://api.businesscentral.dynamics.com/v2.0/{environment name}/api/microsoft/automation/v1.0/companies({companyId})/configurationPackages('{packageName}')/file('{packageName}')/content
Authorization : Bearer {token}
Content-type : application/octet-stream
If-Match:*
Body: binary stream
----------------------------------------------------------------------------------------------------------------------
Users and User Groups:
----------------------------------------------------------------------------------------------------------------------
GET https://api.businesscentral.dynamics.com/v2.0/{environment name}/api/microsoft/automation/v1.0/companies({id})/users
----------------------------------------------------------------------------------------------------------------------
Permission Set:
----------------------------------------------------------------------------------------------------------------------
POST https://api.businesscentral.dynamics.com/v2.0/{environment name}/api/microsoft/automation/{apiVersion}/companies({companyId})/users({userSecurityId})/userPermissions
Authorization: Bearer {token}
{
"id": "SECURITY"
}
----------------------------------------------------------------------------------------------------------------------
Post Extension:
----------------------------------------------------------------------------------------------------------------------
POST https://api.businesscentral.dynamics.com/v2.0/{environment name}/api/microsoft/automation/v1.0/companies({companyId})/extensions({packageId})/Microsoft.NAV.install
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
POST https://api.businesscentral.dynamics.com/v2.0/{environment name}/api/microsoft/automation/v1.0/companies({companyId})/extensions({packageId})/Microsoft.NAV.uninstall
----------------------------------------------------------------------------------------------------------------------
How cool, isn't it?
Know more about extensions: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/dynamics-microsoft-automation-overview
More examples on Automaton API: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/itpro-introduction-to-automation-apis
I hope this blog was helpful. Let me know what should I write next!
Write your suggestions in the comment section.
You can also email me at jyotsnaoberainav@gmail.com
Also, visit my website JONAV if you need help with any NAV/BC Services!
Thank you!
We want to use some web services in NAV however those services is not accessible on server even if Internet is working on server Like getting currency exchange rate user service provided by bank and automatically creating lines in currency exchange rate table
ReplyDeleteWhat can be reason???
We want to use some web services in NAV however those services is not accessible on server even if Internet is working on server Like getting currency exchange rate user service provided by bank and automatically creating lines in currency exchange rate table
ReplyDeleteWhat can be reason???
Thank you for the comment.
DeleteCheck the following:
1. Web service url, port, config file
2. Firewall
3. Basic authentication
4. Odata and soap url is enabled in administrator.
Thank you.
This comment has been removed by the author.
ReplyDelete👍
Delete