Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

APIs in Business Central showing authentication failed

(0) ShareShare
ReportReport
Posted on by 585

Hello Experts, 

I am using Basic Authentication and web Access Key to hit Business Central API: https://api.businesscentral.dynamics.com/v1.0/domainname/Sandbox/api/beta/companies with a GET request. 

Unfortunately, I am getting an error from Postman:

{
    "error": {
        "code""Authentication_InvalidCredentials",
        "message""The server has rejected the client credentials.  CorrelationId:  5e0b0833-cef9-4e89-9628-56400f373b2a."
    }
}
Could you please help me out with this.
 
Thank you in advance. 

Regards

Jyotsna Oberai

Categories:
  • Suggested answer
    adel@vsi Profile Picture
    45 on at
    RE: APIs in Business Central showing authentication failed

    Following worked for me for basic authentication.

    1. User user name without domain

    2. If using google chrome, user developer tools to get the web-services key. Simply copy doesn't copy whole thing.

  • Jyotsna NAV Profile Picture
    585 on at
    RE: APIs in Business Central showing authentication failed

    Hi Stefano,

    It worked! I was missing v1.0 in the url. Thanks a lot!

    Thank you everyone for your help :)

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,152 on at
    RE: APIs in Business Central showing authentication failed

    The endpoint I’ve provided works. 
    If the endpoint is correct, please check username (use it without domain), web service access key and its expiration date.

  • Jyotsna NAV Profile Picture
    585 on at
    RE: APIs in Business Central showing authentication failed

    I tried that. But I am still facing the same error. Don't know what the problem is :(

    4152.Untitled.png

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,152 on at
    RE: APIs in Business Central showing authentication failed

    It seems you're missing the API version. Correct url:

    api.businesscentral.dynamics.com/.../companies

  • Suggested answer
    Binesh Profile Picture
    7,885 on at
    RE: APIs in Business Central showing authentication failed

    Hello Jyotsna,

    if you are make sure your web access key is correct then just  make a small change in the API URL

    Instead of v1.0 replace with v2.0 as shown below

    pastedimage1596176382289v1.png

  • Suggested answer
    TeddyH Profile Picture
    12,775 Moderator on at
    RE: APIs in Business Central showing authentication failed

    Are you using the customer's user ID or partner user ID ?

  • Jyotsna NAV Profile Picture
    585 on at
    RE: APIs in Business Central showing authentication failed

    Thank you for the revert.

    The credentials are correct. The URL is the one that exists in web service: https://api.businesscentral.dynamics.com/tenantId/Sandbox/api/beta

    Still no luck. Please suggest..

    Thank you.

    Regards

    Jyotsna Oberai

  • Suggested answer
    TeddyH Profile Picture
    12,775 Moderator on at
    RE: APIs in Business Central showing authentication failed

    Make sure you use the User Name and Web Service Access Key that are written in the User Card.

    That user also needs to have BC license in that environment. You can't use partner login.

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

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

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

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans