I'm new to Magento I try to call category level using Magento SOAP API with parent category id. I use following code.
<?php
$proxy = new SoapClient('http://domain/index.php/api/soap/?wsdl');
$session = $proxy->login('user', 'password');
$result = $proxy->call($session,'catalog_category.level');
echo json_encode($result);
?>
Here for the above code, "Default Category" details are coming. now I try to call some other category by using following codes.
$result = $proxy->call($session,'catalog_category.level',12);
That is not working
$arguments = array( 'parentCategory' => 12);
$result = $proxy->call($session,'catalog_category.level',$arguments);
This is also not working.
Then I try to call category tree using following code.
<?php
$proxy = new SoapClient('http://domain/index.php/api/soap/?wsdl');
$session = $proxy->login('user', 'password');
$result = $proxy->call($session,'catalog_category.tree');
echo json_encode($result);
?>
it showing all the category tree. it means API is working but whenever I try to pass an argument it showing server not found an error.
Can any one please tell me how to pass arguments with the request.
Best Answer
The above code worked fine for me. If it won't for you then check your corresponding Api.php method.
Gist : Multiple request params are always sent in an array.