JustCurious
JustCurious

Reputation: 183

Outlook 365 API - Disable automatic email send when creating Calendar event

I'm working on a project to migrate Gmail calendar events into Outlook 365, the process is to export the Gmail calendar events using Google Calendar API v3, then convert it to compatible outlook event JSON, then post to Outlook API, using:

POST https://outlook.office.com/api/v2.0/me/events

https://msdn.microsoft.com/en-us/office/office365/api/calendar-rest-operations#create-events

The problem I'm facing is that when the event is created on the 365, it automatically sends an email to all attendees, whether it's old or new event.

As for migrating, it's very bad behavior, migrating 500 events with 3 attendees each, means 1500 email send.

I want to just create the event static as possible, without any email send etc.

I also tried to add a ResponseRequested=false property, but it's do nothing.

Here's an example JSON body with two attendees:

{
  "Body":{
    "ContentType":"TEXT",
    "Content":"Some text to show"
  },
  "Organizer":{
    "EmailAddress":{
      "Name":"Mr. User",
      "Address":"[email protected]"
    }
  },
  "Subject":"MySubject",
  "Attendees":[
    {
      "EmailAddress":{
        "Name":"John Bon",
        "Address":"[email protected]"
      },
      "Status":{
        "Response":"NotResponded"
      }
    },
    {
      "EmailAddress":{
        "Name":"James Claims",
        "Address":"[email protected]"
      },
      "Status":{
        "Response":"Declined"
      }
    }
  ],
  "Start":{
    "DateTime":"2017-08-09T13:00:00+03:00",
    "TimeZone":"Etc/GMT+2"
  },
  "End":{
    "DateTime":"2017-08-09T14:00:00+03:00",
    "TimeZone":"Etc/GMT+2"
  },
  "ResponseRequested":false
}

The Post URI is:

POST https://outlook.office.com/api/v2.0/users/[email protected]/calendars/events"
Authorization: Bearer ya29.GoAB......

Also, if I'm going on a bad direction, and you have a better idea how to accomplish my mission, will be happy to hear...

Any help is much appreciated.

Upvotes: 4

Views: 3616

Answers (1)

abielita
abielita

Reputation: 13469

You may want to refer with this threads:

It suggested the following workarounds:

  • Uncheck the box in send invitation to the group.
  • When creating the calendar event if you set the Status to Free and Reminder to None, the appointment will be set on the calendar and an invite to the group will not be sent.
  • set the parameter AlwaysSubscribeMembersToCalendarEvents to False

Upvotes: 3

Related Questions