Can anyone tell what is odata version used by SharePoint REST Api?
I am asking because I tried to run the Nested Filter in Expand supported by OData V4. http://www.odata.org/getting-started/basic-tutorial/ :
OData V4 supports nested filters in $expand. The request below return People and all their trips with Name "Trip in US". GET serviceRoot/People?$expand=Trips($filter=Name eq 'Trip in US')
Then I tried to
/_api/Web/Lists/GetByTitle('Conglomerates')/items?&$select=Id,Title,Company/Title,Company/Id&$filter=Company eq 18&$expand=Company($filter=Id eq 18)
and got
{"odata.error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The expression \"Empresa($filter=Id eq 18)\" is not valid."}}}
_api/Web/Lists/GetByTitle('Conglomerates')/items?$expand=Company&$select=Id,Title,Company/Title&$filter=Company/Id eq 18
(assuming 18 is the value of some field in the Company list - I used 'ID' but it could be another one). If you want to filter the "main" list in your query using a field in the lookup list there's no need to do Nested Filters. They are useful when you want to filter the associated items in the lookup list, as the example quoted from OData tutorial -return People and *all their trips with Name "Trip in US"*