Skip to content

Can we get filtered response from magento where we have to filter a nested object inside an array

{
“items”: [
{
“id”: 407,
“media_gallery_entries”: [
{
“id”: 1395,
“media_type”: “image”
}
]
},
{
“id”: 407,
“media_gallery_entries”: [
{
“id”: 1396,
“media_type”: “image”
}
]
}
]
}

https://developer.adobe.com/commerce/webapi/rest/use-rest/performing-searches/

https://domain.com/rest/default/V1/products?searchCriteria[filter_groups][0][filters][0][field]=media_gallery_entries&searchCriteria[filter_groups][0][filters][0][field]=id&searchCriteria[filter_groups][0][filters][0][value]=1397

How can I query for media_gallery_entries id value is 1396. I know above query won’t work. Please help.