Microsoft graph api throws The mailbox is either inactive, soft-deleted, or is hosted on-premise while creating event

Amitkumar Bhatt 61 Reputation points
2022-03-07T10:30:10.553+00:00

I want to create meeting event. I have added user in azure ad and also assigned delegated permission Calendars.ReadWrite.

But while creating event by following lines it throws error:
var response = await graphClient.Me.Calendar.Events.Request().AddAsync(@event);

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

When I am adding Microsoft 365 developer lincense to user then it is working.

I want to provide this functionality to whole tenant users, Do I need license for all of them?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,779 questions
0 comments No comments
{count} votes

Accepted answer
  1. JanardhanaVedham-MSFT 3,536 Reputation points
    2022-03-07T12:05:02.267+00:00

    Hi @Amitkumar Bhatt ,

    As you can see below,I have also replicate the above mentioned issue using an Azure AD user with no valid M365 license assigned. You are getting this error because no Exchage Online mailbox is available to use for the azure ad user who do not have a valid M365 license. Please note that Exchange Online mailbox and outlook calendars will only be available/created for the users with a valid M365 license.

    Example : Issue replication with Azure AD user without valid M365 license (Exchange Online) assignment :

    180663-image.png
    180618-image.png

    Example : Issue resolution post M365 license (Exchange Online) assignment to the user:

    180569-image.png

    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 additional answers

Sort by: Most helpful