Sébastien Pertus
Sébastien Pertus

Reputation: 715

Filtering Onedrive items by lastModifiedDatetime

I try to filter OneDrive items from within the Microsoft Graph endpoint, by lastModifiedDatetime property.

Something like that :

https://graph.microsoft.com/beta/me/drive/special/photos/children?$top=3&$orderBy=lastModifiedDatetime

It doesn't work. The error returned is :

"message": "The request is not supported by the system."

But according to the documentation ( https://dev.onedrive.com/odata/optional-query-parameters.htm#optional-odata-query-parameters )

oderby : Comma-separated list of properties that are used to sort the order of items in the response collection. Works for name, size, and lastModifiedDateTime fields.

By the way, I tried to sort with the name property and it actually works as expected :

https://graph.microsoft.com/beta/me/drive/special/photos/children?$top=3&$orderBy=lastModifiedDatetime

Can you confirm than sorting by lastModifiedDateTime is not permitted with the graph api endpoint ?

Upvotes: 3

Views: 1335

Answers (1)

Marek Rycharski
Marek Rycharski

Reputation: 1704

Filtering by lastModifiedDateTime is not supported for OneDrive for Business. It is supported for OneDrive Personal. The limitation is not specific to the Microsoft Graph endpoint. There is a note about it in the referenced documentation page.

Upvotes: 3

Related Questions