I would like to know how to retrieve products that belong to a specific category in Magento SOAP API V2, with WS-I compliance and also without.
Here's what I've tried in WS-I compliance mode:
$proxy = new SoapClient('http://foobar.local/api/v2_soap/?wsdl'); $sessionId = $proxy->login(array( 'username' => 'foo', 'apiKey' => 'bar' )); $filters = array( 'complex_filter' => array( array( 'key' => 'category_ids', 'value' => array( 'key' => 'like', 'value' => '%1%' ) ) ) ); $result = $proxy->catalogProductList(array('sessionId' => $sessionId->result, 'filters' => $filters)); var_dump($result->result);
I can use the complex filter to successfully filter by
product_id however this fails to work for category_ids as it has another nested level. How can I retrieve products via the Magento API for a certain category ID? Should I be using