3

When a user has created an event in outlook.com shared calendar, the REST API tells that calendar owner is organizer.

I have one calendar in Outlook.com and I'm syncing all calendar event's to my server with a calendar subscription. I get notifications when something happens and there is url in the notification which I can use to get object of that newly created event.

I have now another user in outlook.com and I have shared my calendar to him. When he does something in that shared calendar I get notifications, but I don't get any information about who created new event.

Organizer is always my user and for some reason in the event object name is fine, but email address is something like outlook-[nonsense]@outlook.com (that's not my email address). My real email address is more like lehtu@outlook.com.

See this image for clarification:

enter image description here

The organizer part of the response:

Organizer:
 { EmailAddress:
    { Name: 'Encode Testing',
      Address: 'outlook_2FD8F7EE77CEC8B8@outlook.com' } },

Application auth is made only with my user(which name is Testing in the picture).

Here is my credential:

this.scopes = [
    'openid',
    'offline_access',
    'https://outlook.office.com/calendars.readwrite'
];

Point is to have more calendars under my account and I will share them to others. But I must get the info into my app that who is creating events.

Any ideas?

lehtu
  • 868
  • 1
  • 12
  • 27
  • 1
    Reporting to our calendaring devs. – Jason Johnston Aug 23 '16 at 12:15
  • Ok, so the account that actually owns the calendar, is their primary email address an outlook.com address, or something else? – Jason Johnston Aug 23 '16 at 20:21
  • Primary email is with custom domain. But this madness about organizer's seemst to be a 'feature'. If I look at the calendar in browser or via api with user Testing(owner of the calendar), it looks like he is organizer in all events, even if he didn't create those. And when Im looking at that same calendar with Testing2 user(who got access via sharing) via api or in browser, it looks like he owns all the events in that calendar. Now I tested this in office365 and there the owner of calendar is ALWAYS organizer in all events. No matter how you are looking at them and who created events.. – lehtu Aug 23 '16 at 21:21
  • But if I want to get right organizers in events, I have to use Rooms in office365. Then it works almost like I wanted to.. Now only problem is that, in the Room's calendar is showing only organizer's name as subject. And no body at all? – lehtu Aug 23 '16 at 21:23

1 Answers1

0

It is expected that the organizer of events on a shared calendar is always the owner of said calendar. Essentially Testing2 has created the event on Testing's behalf, but Testing2 does not become the organizer. The odd email address you are seeing for Testing is his underlying outlook.com email, which is added since you're using a custom domain.

Unfortunately today it doesn't seem like the API directly exposes information regarding who actually created an event. This is probably a good feature to suggest on UserVoice. However, you might be able to access it indirectly.

Whenever the API doesn't directly expose a property, you can look at the underlying properties exposed by Exchange server. I usually look them up in the MS-OXPROPS doc. I found PidTagCreatorName, which looks like it might help get the data you're after.

You can usually access these underlying properties by expanding (via $expand) the SingleValueExtendedProperties collection on items. So if you do a GET on the following:

https://outlook.office.com/api/v2.0/me/events?
$expand=SingleValueExtendedProperties($filter=PropertyId eq 'String 0x3FF8')

You'll see results returned that look something like:

{
    ...
    All the normal props you usually see
    ...
    "SingleValueExtendedProperties": [
        {
            "PropertyId": "String 0x3ff8",
            "Value": "Jason Johnston"
        }
    ]
}
Jason Johnston
  • 17,194
  • 2
  • 20
  • 34