Which API’s are available in my Business Central environment?

Here’s a short post with a small tip about something a lot of you probably already know. How’s that for an intro 🤪.

If you remember these posts:

Then you know there’s quite a lot of information .. just under your fingertips of the web client.

And that’s also the case for API information. Because really .. figuring out het available API’s in your system isn’t that easy at first sight. It is easy when you know where to look, though.

Well, if you want, you can get that info from a system-table. Namely table “API Web Service”, which is table 2000000193. So, if you would add “?table=2000000193” in the URL .. you’d get a list of all available APIs :-).

At least … if you’re working OnPrem. For some dark reason, I (admin) am not allowed to read that table in SaaS .. .

I wonder why .. I really am … . If anyone has a clue why – please put it in the comments.

Does that mean there is no solution in SaaS? Can’t I list all API endpoints simply from the web client? Well .. still yes, but a little bit with a detour. In fact, it was the API guru AJ that gave an alternative table that also has quite a lot of metadata: namely table “page metadata” (2000000138). If you filter the data on pagetype “API”, you get almost exactly the same as with the “API Web service” table – although, only pages, not queries – but at least it works in SaaS.

But then you might wonder .. Isn’t there a table “query metadata” that I could use as well? Sure, that would be table 2000000142 :-). But … that one is again only available OnPrem for another dark reason :(.

Last but not least, you might wonder if there was an API way to get to all APIs. Yep! And it was again the API guru himself that showed me this undocumented feature. The URL you’ll need for this is:

https://api.businesscentral.dynamics.com/v2.0/{{tenantid}}/{{env}}/api/microsoft/runtime/beta/companies({{CompanyId}}/apiRoutes

It will basically give you a list of the “routes” to the different APIs (shows the publisher/group/version):

So, let’s say we’ll take the last entry. To form a decent URL, it’s simply:

https://api.businesscentral.dynamics.com/v2.0/{{tenantid}}/{{env}}/api/waldo/trainings/v1.0

Which will, in its turn, give me a list of “API entities” that I can use for this publisher/group/version.

That’s it. Thanks AJ for helping to make the post a bit more complete ;-). Enjoy!

5.00 avg. rating (98% score) - 4 votes

Permanent link to this article: https://www.waldo.be/2021/02/19/which-apis-are-available-in-my-business-central-environment/

2 comments

1 ping

    • duichwer on February 19, 2021 at 5:11 pm
    • Reply

    I guess there’s a little Typo in the URLs.
    It should be companies with i.

      • waldo on March 3, 2021 at 4:12 pm
        Author

      Thanks, I corrected it!

  1. […] Source : Waldo’s Blog Read more… […]

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.