I'm GETing data in JSON through a WebAPI by sending cURL requests to the server - basically works. Problem starts when I'm trying to filter for a field in (sorry, layman's terms) the 2nd layer of the JSON data.
Here's some example JSON data:
{ "id": "SOMEHASH", "name": "OPP-Name", "actualCloseDate": "9999-12-31T00:00:00+01:00", "companies": [ { "id": "SOMEOTHERHASH", "name": "Company Name" } ],
I'm trying to filter for the field "name" in the array "companies" (that's what I meant with 2nd level), but so far no luck. My URL to request the data including an OData filter looks like that right now:
https://www.ourserver.tld/Opportunities/?$filter=Company/any(d:d/name eq 'Company Name')
but that only results in an empty response, as if no data were found (the name's a match for sure). To be honest, I don't understand the "d:d" part, just took that straight from the OData docs.
I tried
https://www.ourserver.tld//Opportunities/?$filter=companies/any(name eq 'Company Name')
instead, but that throws a syntax error. So, how to I form a correct request URL?