web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

APIs in Business Central Saas showing authentication failed?

(0) ShareShare
ReportReport
Posted on by 15

I have a Business Central container in Azure. I am able to connect to the BC instance. I perform a search for Users and retrieve the "Web Access Key"

I then call the following in Postman:

  api.businesscentral.dynamics.com/.../<Tenant Id>/sandbox/api/beta/companies

witH Basic Auth: username is the name in BC password is the Web Access Key.

The tenant Id i just retrieved from Azure Active Directory ->Overview

I get the following error:

{
    {
         "error": {
      "code": "Authentication_InvalidCredentials",
      "message": "The server has rejected the client credentials.  CorrelationId:  <GUID>."
    }
 }
      

Is there something I am missing here ?

I need to get the company id back so I can call the following , because I am using webhooks for push notifications like the following :

GET
https://{businesscentralPrefix}/api/microsoft/runtime/beta/companies({{companyId}})/webhookSupportedResou rces?$filter=resource eq 'v2.0*'

Also if i try to call the following:in Postman:

    api.businesscentral.dynamics.com/.../<IP ADDRESS SAAS CONTAINER>/BC/Sandbox/api/microsoft/automation/v1.0/$metadata

  It gives back 

{
    "error": {
        "code""RequestDataInvalid",
        "message""Request data is invalid."
    }
}
I would have expected to get back some data to be able to get companies and there id's .
Any ideas on this ?

I have the same question (0)
  • KarenSaunders Profile Picture
    15 on at

    Hi Andy,

    Still get the same error. Not sue if i am doing somethin wrong.

    These are the steps i took .

    I created a BC container on Azure using the command az container create .... now in that I could not specify the --includeTestToolKit as it was not a legal parameter. In the New-BCContainer that is a legal parameter but thats for onPrem, i wanted Saas.

    After creating the container on Azure I went to a browser and typed

    http://<IP ADDRESS OF CONTAINER IN AZURE>/BC/api/v2.0/$metadata

    to see if there are any installed Apis's.

    that returned an error:

             "Sorry, the page could not be found"

    So then I went to BC via the url and logged in with my username and password , typed in user in the search and selected ADMIN. I changed the web access key and saved. I then copied the web access key and went to Postman and put that in as the Basic Auth for name and password being the web access key, with a url of

    api.businesscentral.dynamics.com/.../<IP ADDRESS OF CONTAINER IN AZURE>/BC/sandbox/api/v1.0/$metdata.

    I would have thought it would have given a list of the available API's but sill gave

       <code>Unauthorized</code>

       <message>The credentials provided are incorrect</message>

    Can i somehow add the testtoolkit to the saas instance ?

    Or do i need to redeploy using another strategy ?

    Another question for knowledge: In the url for saas , I have a container that sits in a ResourceGroup, so if i get the tenant id from Azure AD, how will it know to go there ? 

  • Suggested answer
    Andy Sather Profile Picture
    on at

    Hello Karen - In Postman I changed my GET to this and I got a Company list:

    api.businesscentral.dynamics.com/.../Company

    Let me know if this helps!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,476

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 789 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 719 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans