Access is denied. Check credentials and try again. REST APIs for this mailbox are currently in preview.

mohamed arshad 31 Reputation points
2022-06-24T07:07:43.387+00:00

So the issue is I'm making this API call (below):
Request:

   GET https://graph.microsoft.com/v1.0/me/mailFolders('SentItems')/messages   
   Authorization: Bearer <access token>  
   Scopes: openid profile User.Read email Mail.ReadBasic Contacts.Read   
   Oauth Flow: on_behalf_of  

Response:

   "error": {  
               "code": "ErrorAccessDenied",  
               "message": "Access is denied. Check credentials and try again. REST APIs for this mailbox are currently in preview. You can find more information about the preview REST APIs at https://dev.outlook.com/.",  
               "innerError": {  
                 "date": "2022-06-23T10:57:21",  
                 "request-id": "57b4f72e-903b-4286-9b20-59c4f4003182",  
                 "client-request-id": "57b4f72e-903b-4286-9b20-59c4f4003182"  
               }  
             }  

** Issue Description:**

  • Im having Mail.ReadBasic but still its throwing the error for some Org Accounts
  • This API call is returning 403 for only some Microsoft Organizational Accounts only and not all
  • let say we have organization foo.com Its working for some users ( bar@Anonymous .com ) within the organization and throwing this error for ( baz@Anonymous .com). this is why im lost
  • for all personal Microsoft accounts its working fine

Any help is greatly appreciated
Thanks

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,315 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,442 questions
0 comments No comments
{count} votes

Accepted answer
  1. Srinivasa Rao Darna 6,711 Reputation points Microsoft Vendor
    2022-06-24T09:52:18.317+00:00

    Hi @mohamed arshad ,

    The user who is experiencing issues have mailbox in on-premises?

    Currently REST APIs for hybrid setup is in preview and the preview APIs are going to be deprecated in Mar 2023 Use REST APIs to access mailboxes in Exchange hybrid deployments (deprecated).
    So the current alternative Exchange Web Services (EWS) to work with Exchange Server (on-premises) mailboxes.

    Hope this helps.

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


0 additional answers

Sort by: Most helpful