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

Microsoft Exchange Online
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,483 questions
Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,795 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,316 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.