Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Unanswered

Common api / authentication errors

Posted on by

This is a post to place typical errors and solutions to make them searchable to Bing. Please feel free to add your own examples as and when you come across something that may be useful to others.

Error:

When just running a general API call (just GET on companies), postman shows this error:

    "error": {
        "code""Authentication_InvalidCredentials",
        "message""Web service call failed because user could not be authenticated or authorized.  CorrelationId:  0e82377d-b2af-437d-be1d-71c99ea29421."
    }
This error is a generic "something went wrong in authentication"-error, so if possible try to get more details, either via telemetry, or for OnPrem, if you get this warning in the Applicatoin Log:
Message User signed in with the following information: user type=Normal user, entitlement set Ids=, authorization status=Failed, guest user=False, failure reason=A user successfully authenticated in Azure Active Directory but the user does not have any entitlements in Business Central.

Then one possible option is that the role-section is missing in the token. Decode the token for example on JSON Web Tokens - jwt.io and check that the token contains a section like this:
"roles": [
"Automation.ReadWrite.All",
"app_access",
"API.ReadWrite.All"
]
In postman, go to "Advanced Options" and set Resource = api.businesscentral.dynamics.com/:
pastedimage1660563976217v1.png
======
  • Suggested answer
    Saurav.Dhyani Profile Picture
    Saurav.Dhyani 17,965 Super User 2024 Season 2 on at
    Common api / authentication errors

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans