Easier way to retrieve (all) extended properties for an event?

639 Views Asked by At

As a followup to How to retrieve extended properties for calendar event (by name)? and How to retrieve extended properties of type datetime? :

I actually have to retrieve 4 custom property values (string, datetime, 2 integers).
The URL then becomes (line wraps added by me):

https://graph.microsoft.com/v1.0/users/{{UserID}}/calendar/events/{{TTSyncedEventID}}?$expand=singleValueExtendedProperties(
$filter=id eq 'Integer {00020329-0000-0000-C000-000000000046} Name TTID' 
     or id eq 'String {00020329-0000-0000-C000-000000000046} Name TTSyncID' 
     or id eq 'Integer {00020329-0000-0000-C000-000000000046} Name TTSyncVer' 
     or id eq 'SystemTime {00020329-0000-0000-C000-000000000046} Name TTSyncTime')

That's quite a URL! (note: {{ }} are Postman variables)

Is there an easier way to retrieve (all) extended properties for an event?

The documentation for Get singleValueLegacyExtendedProperty states:

Use a $filter and eq operator on the id property to specify the extended property. This is currently the only way to get the singleValueLegacyExtendedProperty object that represents an extended property.

... which suggests 'no', but maybe there is something smart I can do with the $filter?

1

There are 1 best solutions below

0
On

Unfortunately, there is no other way to get all extended properties then by specifying their id and eq operator.

$filter parameter doesn't support in operator for singleValueLegacyExtendedProperty, so you can't write something like this

/v1.0/users/{{UserID}}/calendar/events/{{TTSyncedEventID}}?$expand=singleValueExtendedProperties(
$filter=id in ('Integer {00020329-0000-0000-C000-000000000046} Name TTID','String {00020329-0000-0000-C000-000000000046} Name TTSyncID','Integer {00020329-0000-0000-C000-000000000046} Name TTSyncVer','SystemTime {00020329-0000-0000-C000-000000000046} Name TTSyncTime'))