Microsoft Graph; Create calendar event; how to set ICalUId so that later I can find the event via the ICalUId

Viewed 12

I am trying to create events via the MS Graph API (with Powershell but using the REST API).

So far I can create events without problems. All the properties I want to set are correctly set - except I don't seem to manage to set the IcalUId - as I cannot find such created events via

"/users/$UPNofMBX/calendar/events?`$filter=iCalUId eq '$appointment_UID'"

($Appointment_UID = the desired identifier for later finding the event - It is coming from an external - commercial solution)

If I import via Outlook an ICS file with a specific value in the "UID:" field, the above Graph query finds the event which carries the searched for value in the ICalUId field.

If I set it at creation time via graph with the below body, the above search quiery line does not find the event.

My body looks like this:

$Body = @"
{
    "subject": "$appointment_Subject",
    "iCalUId": "$appointment_uid",
    "body": {
      "contentType": "HTML",
      "content": "$appointment_Body"
    },
    "start": {
        "dateTime": "$appointment_Time_Start",
        "timeZone": "Europe/Berlin"
    },
    "end": {
        "dateTime": "$appointment_Time_End",
        "timeZone": "Europe/Berlin"
    },
    "location":{
        "displayName":"$appointment_Location"
    },
    "attendees": [
      {
        "emailAddress": {
          "address":"$UPNofMBX",
          "name": "Ressource"
        },
        "type": "required"
      }
    ],
    "allowNewTimeProposals": false,
    "transactionId":"$(New-Guid)"
  }

Unfortunately, in none of the examples @ Microsoft is the use of the ICalId explained when creating an event. Also I didn't find any examples on the net.

Any insight what I am doing wrong is greatly appreciated.

0 Answers
Related