ExtensionError - Operation: Create; Exception: [Status Code: Forbidden; Reason: Access is denied. Check credentials and try again.]

Daniel Camcho 20 Reputation points
2025-01-19T20:04:18.6633333+00:00

Hi Everyone,

I try to use the api from ms graph to create subscrption specific user:

https://learn.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-1.0&tabs=httpUser's image

I already added all permissions related to mail to my tenant:User's image

User's image

and here is the information of token after i used jwt to encode the token:User's image

could anyone help me to know what is the issue or what are the missing roles?

Thanks

Daniel

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Akhil Nasalwai - MSFT 1,685 Reputation points Microsoft External Staff
    2025-01-20T00:40:44.78+00:00

    Hello Daniel Camcho,

    Thank you for contacting Microsoft!

    For the issue while creating subscriptions using Graph API, the error 403 forbidden indicates the issue might be related to the permissions.

    Ensure you have the correct permissions granted as per the documentation and the admin consent is provided by the admin for the granted permissions in the Entra portal for the application.

    Link: permissions

    Also, please make sure the notification URL is validated as per the below reference documentation.

    Link: notification-endpoint-validation

    As per the encoded token from the jwt shared above in the post, we could not find roles in the token, so please re-check your permissions and admin consent if any permissions are changed.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

  2. CarlZhao-MSFT 46,371 Reputation points
    2025-01-20T02:31:58.4933333+00:00

    Hi @Daniel Camcho

    I noticed that your token does not contain any permissions, this is because the permissions you assigned to the calling app have not been consented by the admin.

    Try logging into your MS Entra ID as a global admin, then find the current app and grant admin consent for the permission.

    0c25031f-2d53-418b-83a4-3da4bcc7ac55

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    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.