2

I'm trying to use the MS Graph API to create a new event with a technical user on behalf of a resource. The event is created, but the organizer and isOrganizer Attributes are not considered or ignored in the response.

I tried multiple requests as well as in 'v1.0' and 'beta' mode. In this SO question How to create event where current user not organizer using Microsoft Graph API it is stated that this is not implemented at the time of the original post (2016). But I didn't find anything in the Graph-API docs, saying that this would not work.

This is the request body:

{
                "subject": "Instant Meeting: " + user_name,
                "body": {
                    "contentType": "HTML",
                    "content": "Dieser Termin wurde vom Konferenzraum eingestellt"
                },
                "isOrganizer": "false",
                "organizer" : {
                    "emailAddress": {
                        "address":user_email,
                        "name": user_name
                    }
                }, 
                "start": {
                    "dateTime": start,
                    "timeZone": "Europe/Berlin"
                },
                "end": {
                    "dateTime": end,
                    "timeZone": "Europe/Berlin"
                },
                "location":{
                    "displayName": room.get('name'),
                    "locationEmailAddress": room.get('email'),
                    "locationType" : "conferenceRoom"
                },
                "attendees": [
                    {
                    "emailAddress": {
                        "address":user_email,
                        "name": user_name
                        },
                    "type": "required"
                    },
                    {
                    "emailAddress": {
                        "address":room.get('email'),
                        "name": room.get('name')
                        },
                    "type": "resource"
                    }
                ]
                }

The relevant parts of the response are:

response.get('organizer')

{'emailAddress': {'address': 'testraum-nichtbuche...t-mail.de', 'name': 'TestRaum - NICHT BUCHEN'}}
'emailAddress': {'address': 'testraum-nichtbuche...t-mail.de', 'name': 'TestRaum - NICHT BUCHEN'}
__len__: 1

response.get('isOrganizer')

True

If this worked properly, I would expect the 'organizer' to be user_email and the flag to be set to False.

Can anyone provide a working example for this?

Thanks!

Daniel Kaupp
  • 165
  • 2
  • 12

2 Answers2

1

This behavior has not changed. The organizer and isOrganizer properties cannot be defined by the caller, they are automatically assigned by Exchange:

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
0

Actually, there is a way to set up an organizer via API. It can be done via extended properties.

There are 3 properties:

  1. 2.1016 PidTagSentRepresentingName - the Name of the organizer.
  2. 2.1012 PidTagSentRepresentingAddressType - the Address Type. Usually SMTP or EX.
  3. 2.1013 PidTagSentRepresentingEmailAddress - the Address of the organizer.

So, if you want to set up the new organizer, you should set all 3. Please note that the id equals the Property ID of the relevant property. And you want to set AddressType as SMTP if you setting the SMTP.

PATCH request like that should work:

{
  "singleValueExtendedProperties": [
    {
        "id": "String 0x0042",
        "value": "Updated Organizer"
    },
    {
        "id": "String 0x0064",
        "value": "SMTP"
    },
    {
        "id": "String 0x065",
        "value": "updated@organizer.com"
    }
  ]
}

Here is how it looks in Graph Exlorer: organizer_patch

And then you can see new organizer in the OWA: new_oganizer

Vadim Iarovikov
  • 1,941
  • 1
  • 14
  • 20
  • 1
    Thanks [@Vadim Iarovikov](https://stackoverflow.com/users/978002/vadim-iarovikov) for a great answer, it is the only way I can see to set a different organizer when creating an event. However with this solution, the "isOrganizer" property is still set to "true" and I can't find a way to change that. Any ideas? – WindsorSean Jun 28 '23 at 20:54
  • Hi @WindsorSean, not sure actually. In my workflow, this was not required. So in the UI it's the new organizer and that was enough. But you can try to set this property: 2.392 PidNameCalendarIsOrganizer (https://learn.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxprops/0f0dbb53-936c-47dc-985d-f0917e0a092c) the same way as the properties above. – Vadim Iarovikov Jul 02 '23 at 13:22