0
votes

I'm trying to create an event into a calendar that mocks an event created directly on Microsoft Teams. So basically when you create an event via Microsoft Teams you can specify the group & the channel that must be part of the event.
I'm using the proper endpoint: https://docs.microsoft.com/en-us/graph/api/user-post-events?view=graph-rest-1.0&tabs=http.
This is the info I'm passing as post request :

{
    subject:"Event Subjct",
    isOrganizer: true,
    start: {
        dateTime:"2020-12-29T12:00:00",
        timeZone:"Pacific Standard Time"
    },
    end: {
        dateTime:"2020-12-29T14:00:00",
        timeZone:"Pacific Standard Time"
    },
    isAllDay: false,
    allowNewTimeProposals: true,
    isOnlineMeeting: true,
    attendees: {
        {
            emailAddress: {
                address:"<groupName@emailaddress.ext>", <-- got directly from Azure
                name:"<TeamGroupName>"
            },
            type:"required"
        }
    },
    hideAttendees: false,
    type: "singleInstance",
    transactionId: "<UNIQUE_ID>",
    onlineMeetingProvider: "teamsForBusiness"
}

Note: all values between <..> are placeholder.

The event is correctly created but there's no reference on the Team channel group specified in the attendees field. I've search the definition of attendees array and there's nothing specific to note a group+channel in the attendee collection : https://docs.microsoft.com/en-us/graph/api/resources/attendee?view=graph-rest-1.0

Any help?
Thanks

1
You need to use following API call to achieve the above stuff. Adding the code sample in the answer (below), so feel free to test it out and let me know if it works.Dev

1 Answers

0
votes

You need to use the following API call to create the event in the Groups. For example, you need to use:

POST https://graph.microsoft.com/v1.0/groups/01d4ee64-15ce-491e-bad1-b91aa3223df4/events
Content-type: application/json

 {
  "subject": "Let's go for lunch",
  "body": {
    "contentType": "HTML",
    "content": "Does late morning work for you?"
  },
  "start": {
      "dateTime": "2019-06-16T12:00:00",
      "timeZone": "Pacific Standard Time"
  },
  "end": {
      "dateTime": "2019-06-16T14:00:00",
      "timeZone": "Pacific Standard Time"
  },
  "location":{
      "displayName":"Harry's Cafe"
  },
  "attendees": [
    {
      "emailAddress": {
        "address":"adelev@contoso.onmicrosoft.com",
        "name": "Adele Vance"
      },
      "type": "required"
    }
  ]
}