I tried to get a list of events from Microsoft Graph following this documentation.
I would like to get the list with order by lastModifiedDateTime and then id.
Here is the sample query:
var getResource = string.Format("/me/calendar/events/?$filter=lastModifiedDateTime ge {0}&$orderBy=lastModifiedDateTime, id", XmlConvert.ToString(updatedMin, XmlDateTimeSerializationMode.Utc));
However, when I executed it, it results an error:
{
"error": {
"code": "ErrorInvalidProperty",
"message": "The property 'Id' does not support filtering.",
"innerError": {
"request-id": "bb56a0d0-46f3-4b7c-80bd-043a0b3fd8b5",
"date": "2018-09-17T15:23:40"
}
}
}
In fact, I didn't set the Id within $filter, but instead, I set it as $orderby.
When I tried to exclude the Id from $orderby, it works. Here is the working query:
var getResource = string.Format("/me/calendar/events/?$filter=lastModifiedDateTime ge {0}&$orderBy=lastModifiedDateTime", XmlConvert.ToString(updatedMin, XmlDateTimeSerializationMode.Utc));
Anyone has an idea on how to order the list based on Id as well?