tags:

views:

354

answers:

2

I am creating web service for my store. I am using magento API to collect product list from store. But it display all the 500 records. And i want it 25 records per page. What to add in API call? Or What filter will be apply for this?

//create soap object $proxy = new SoapClient('http://localhsot/magento/api/soap/?wsdl');

// create authorized session id using api user name and api key
// $sessionId = $proxy->login('apiUser', 'apiKey');
$sessionId = $proxy->login('test_admin', '12345678');

    $filters = array(


    );


 // Get list of product
$productlist = $proxy->call($sessionId, 'product.list', array($filters));

print_r($productlist ); 
A: 

I am not sure of this but you could try this, as the API is working with collections and this is the way to limit a collection size

$filters = array(
    'setPageSize' => 10
);
Elzo Valugi
A: 

that didn't work, can you limit it by id like:

$filters = array('id'=>array("gteq"=>1), 'id'=>array("lteq"=>1000));

that way you could add some paging?

Troy