How to solve "MailboxInfoStale" error while calling create event in calendar using graph calendar API in postman?

Ahmed Saad 0 Reputation points
2023-03-29T07:44:08.27+00:00

Unable to create calendar events using the Microsoft Graph API in Postman. Here are the steps that I have followed.

First, I have created an access token with the below parameters.

POST URL: https://login.microsoftonline.com/common/oauth2/v2.0/token

Headers:

client_id: xxxx-xxxx-xxx-xx

client_secret : xxxx-xxxx-xxx-xx

grant_type : client_credentials

redirect_uri_: my_website__URL

scope: https://graph.microsoft.com/.default

After hitting this, I get an access token.

Then, I used that access token to call the Create Calendar Event API below in Postman.

POST URL: https://graph.microsoft.com/v1.0/users/0234a74db7025be7/events

Headers:

User's image

Body:

{
  "subject": "Let's go for lunch",
  "body": {
    "contentType": "HTML",
    "content": "Does next month work for you?"
  },
  "start": {
      "dateTime": "2023-03-26T03:00:00",
      "timeZone": "Pacific Standard Time"
  },
  "end": {
      "dateTime": "2023-03-26T04:00:00",
      "timeZone": "Pacific Standard Time"
  },
  "location":{
      "displayName":"Harry's Bar"
  },
  "attendees": [
    {
      "emailAddress": {
        "address":"******@contoso.onmicrosoft.com",
        "name": "Adele Vance"
      },
      "type": "required"
    }
  ],
  "isOnlineMeeting": true,
  "onlineMeetingProvider": "teamsForBusiness"
}

After hitting this, I got a response of 503 Service Unavailable with the below error message.

{
    "error": {
        "code": "MailboxInfoStale",
        "message": "Target resource '00030000-59d9-871a-0000-000000000000' hosted on database '9b83a49a-fa76-4204-9528-a9f9976b74e7' is currently on backend 'Unknown'"
    }
}

Also, I have added all the calendar and group delegated and application permissions to the Azure Active Directory.

Can anyone help me with this?

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,376 Reputation points
    2023-03-29T09:20:54.88+00:00

    Hi @Ahmed Saad

    Don't try to use the /common endpoint in the client credentials flow, because that flow is an unattended authentication flow, there is no user login.

    Please change /common to /{tenant id}.

    40

    Call the create calendar event API:

    User's image

    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.


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.