Monday, June 15, 2020

Automation API in Dynamics 365 Business Central 2020 Wave 1 April 2020 release

Hi Readers, 
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.


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? 




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!
 


5 comments:

  1. 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
    What can be reason???

    ReplyDelete
  2. 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
    What can be reason???

    ReplyDelete
    Replies
    1. Thank you for the comment.
      Check 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.

      Delete
  3. This comment has been removed by the author.

    ReplyDelete