Api Query Format For Products With Variant Id's

Hi,

I have setup an api request via $POST data with multiple variant_id's which works fine in displaying json data however I can't seem to get exact filtered matches of the submitted values in the url string. The results include all products with any of those variants but not matching the exact string of variants requested. I have tried multiple combinations but can't seem to narrow down the results like one would be able to filter on the front end of the website with the sidebar checkboxes.

The query url format is:

http://example.com/api/categories/id/products?status=A&variant_id=x&variant_id=y&variant_id=z. etc

Since the products have multiple features, there are multiple variant_id's which are used to try filter a response and can vary between 4 and 6 variant_id's in the request which results in loads of products displaying since they contain any of those variants.

The Features are loaded as Multiple Checkbox options and some products do have multiple options per Feature.

Has anyone encountered a similar problem and found a format which returns exact matches or can perhaps suggest a better format?

Thanks

Matt

Try to make search by feature variants in the admin panel and check which parameters are used in the search query. Then copy them to your URL and check the result

Try to make search by feature variants in the admin panel and check which parameters are used in the search query. Then copy them to your URL and check the result

Thanks eComLabs,

Not sure what you mean by search in the admin panel?

Try to make search by feature variants in the admin panel and check which parameters are used in the search query. Then copy them to your URL and check the result

Not to worry eComLabs, I figured out the search. Thanks for the help. I'll let you know if it works with the api.

Try to make search by feature variants in the admin panel and check which parameters are used in the search query. Then copy them to your URL and check the result

Thanks eComLabs, results are now parsing correctly. Appreciate your assistance.

We were glad to help you!