OAuth 2.0 Client Credential | "You do not have the following permissions on Page APIV1 - Customers: Execute." Error

ECalma 1 Reputation point
2021-07-21T02:16:05.667+00:00

I am new to Business Central and I have an API that needs to consume Business Central API.

I have setup the application in Azure AD and also setup the created app in Azure in Business central.

However, whenever I am invoking an API in BC using the token I receive from "https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token" endpoint I am getting an error.

I am not sure what permission I need to assign to the registered application. I have assigned Admin, Full access and Super but no luck.

Error:

{
"error": {
"code": "Internal_ServerError",
"message": "You do not have the following permissions on Page APIV1 - Customers: Execute.\r\n\r\nTo view details about your permissions, see the Effective Permissions page. To report a problem, refer to the following server session ID: '295'. CorrelationId: 81c53d83-6843-4da9-8251-2f1980ef2ad4."
}
}

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,217 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,929 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Marilee Turscak-MSFT 37,056 Reputation points Microsoft Employee
    2021-07-23T17:50:22.823+00:00

    Based on your error it sounds like a licensing issue. Do you have the necessary license assigned? I am not sure about your exact scenario requirements but it looks like you may need a Business Central or Partner license.

    Please also share any additional logs you may have.

    I would also recommend reaching out on the Dynamics 365 forum since this issue seems more related to that. https://community.dynamics.com/f

    0 comments No comments

  2. Henrik Risberg 1 Reputation point
    2021-08-26T07:23:47.837+00:00

    I got the same error when accessing my own api page and solved it by adding more permissions to the client id in Azure Active Directory Application Card in BC.
    I added D365 BASIC in User Permission Sets, but maybe you can do with less or need more permissions.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.