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

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

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@hko .com ) within the organization and throwing this error for ( baz@hko .com). this is why im lost
  • for all personal Microsoft accounts its working fine

Any help is greatly appreciated
Thanks

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
12,602 questions
Microsoft Graph Identity API
Microsoft Graph Identity API
A Microsoft API to access Azure Active Directory (Azure AD) resources to enable scenarios like managing administrator (directory) roles, inviting external users to an organization, and, if you are a Cloud Solution Provider (CSP), managing your customer's data.
257 questions
Microsoft Graph Mail API
Microsoft Graph Mail API
A Microsoft API that supports accessing data in users' primary mailboxes and in shared mailboxes.
679 questions
No comments
{count} votes

Accepted answer
  1. answered 2022-06-24T09:52:18.317+00:00
    SrinivasaRaoDarna - MSFT 6,156 Reputation points Microsoft Employee

    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