The mailbox is either inactive, soft-deleted, or is hosted on-premise.

Sourav 185 Reputation points
2023-11-27T05:00:51.0533333+00:00

When I'm trying to read my email using graph API explorer :
https://graph.microsoft.com/v1.0/me/messages
I'm getting proper response.
When I'm trying to achieve same thing using

await graphServiceClient.Users["******@souravasfaqgmail.onmicrosoft.com"].Messages.GetAsync();


I'm getting this error:

Code: MailboxNotEnabledForRESTAPI Message: The mailbox is either inactive, soft-deleted, or is hosted on-premise.

What would be the proper way to resolve this.
Thanks in advance

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,188 questions
Outlook | Windows | Classic Outlook for Windows | For business
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,376 Reputation points
    2023-11-27T06:11:54.3566667+00:00

    Hi @Sourav

    This error indicates that the target user ("******@souravasfaqgmail.onmicrosoft.com") is missing an Office 365 license.

    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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.