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:

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?