I'm able to get the items from a document library by querying the Graph like this:

https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{library-id}/items

And I get items back that look like the following:

enter image description here

Now I want to filter the results to get only items where the webUrl property contains the text '1808569'. So I change the query to:

https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{library-id}/items?$filter=contains(webUrl,'1808569')

And here is what I get back:

enter image description here

If filtering by webUrl not supported??

2

There are 2 best solutions below

1
On BEST ANSWER

You can filter list items only by fields. Filtering by any property (even by id) is not supported.

GET /v1.0/sites/{site_id}/lists/{list_id}/items?$expand=fields&$filter=fields/Title eq 'foo'

Not sure what exactly your value 1808569 represents in your case but as an alternative you can try to create a custom column on the list with this value 1808569 and then filter items by this custom field

GET /v1.0/sites/{site_id}/lists/{list_id}/items?$expand=fields&$filter=fields/CustomField eq '1808569'

Filter by field may require header Prefer:HonorNonIndexedQueriesWarningMayFailRandomly

1
On

Could you try using filter = startswith(webUrl,'1808569')