Skip to main content

Notifications

Business Central API v2.0

Hello Team!

Some days ago I've got a warning in my code:

3566.JPG

'ODataEDMType' is being deprecated in the versions: '6.0' or greater. This warning will become an error in a future release.

Okay, Microsoft. Let's check how you managed this in standard APIs (because I took this complex JSON object from standard Customers API). But stop - when standard API version changed from Beta to v1.0 that meant no JSON schema changes in future. That's interesting!

Probably you know that downloaded BC symbols you have in VS code doesn't contain APIs code. To get standard API source code you could use this instruction from AJ Kauffmann:

https://www.kauffmann.nl/2019/11/02/where-is-the-api-v1-0-source-code/

I've deployed new container with latest BC version (17.1 at current moment).

Let's see:

Use this command to get info about container apps (replace container name with yours):

Get-BCContainerAppInfo -containername bc17 | select Name, Publisher, Version

0564.JPG

And what we see there are 2 _Exclude_API apps - v1 and v2.

We could download and extract v2 source code with next script:

Get-BcContainerApp `
-containerName bc17 `
-appName _Exclude_APIV2_ `
-publisher Microsoft `
-appVersion 17.1.18256.19630 `
-appFile "C:\ProgramData\NavContainerHelper\apps\_Exclude_APIV2_.app" `
-credential (Get-Credential)

Extract-AppFileToFolder `
-appFilename "C:\ProgramData\NavContainerHelper\apps\_Exclude_APIV2_.app" `
-appFolder "C:\ProgramData\NavContainerHelper\apps\_Exclude_APIV2_"

But let's check directly where is Waldo Address object.

Original v1 Customer API:

3683.JPG

New v2 Customer API:

1513.JPG

Sorry guys, no intrigue - just flat structure instead of complex object. Have no idea why they did this.

Probably that's not the only change, haven't found any announce in docs - just v1.0 replaced to v2.0. So be careful and check your APIs for potential changes.

Comments

*This post is locked for comments