How to filter for a content type Id when getting sharepoint items using the graph api?

Viewed 713

I would like to get all items from a SharePoint list, which have a specific content type.

So far I have tried

  • lists/{myList}/items?$filter=contentType/id eq '{myCTId}'
  • lists/{myList}/items?$filter=contentType/name eq '{myCTName}'
  • lists/{myList}/items?$filter=startswith(contentType/name, '{myCTName}')

None of the above seem to work for me, all resulting in a general error.

"code": "generalException",
    "message": "An unspecified error has occurred.",

Does anyone have an idea/ suggestions on how to achieve this?

1 Answers

As of now filter is not supported on the lists/{listid}/items endpoint and there is already a uservoice raised here. Please upvote it so that this feature could be developed in the future. As a work around you can filter it on your end(writing code).

Related