Saturday, July 9, 2011

Create New category via soap api

In magento 1.5 it's very easy to create a category via soap api

$proxy = new SoapClient('http://magentosite/api/soap/?wsdl');

$sessionId = $proxy->login('apiuser', 'apikey');

$newCategoryId = $proxy->call($sessionId,'category.create',array(3,array('name'=>'New openerp','is_active'=>1,'include_in_menu'=>2,'available_sort_by'=>'position','default_sort_by'=>'position')) );

//where 3 is the parent category

1 comment:

  1. Afternoon,

    I have been pulling my hair out trying to make a custom webservice api for magento 1.5. I beleive all my configurations are correct but when I try to call a my api method, I get an error in the log, because magento is trying to open a my module as Mage/MyMoudule/Model instead of MyCompanyName/MyModule/Model..

    Why is magento looking at the service like it is a 'Mage' api call?

    Do you have a working example I can download an install to magento 1.5?

    Please help I am going crazyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy LMAO!

    ReplyDelete