Magento extension to expose new SOAP API endpoint

304 Views Asked by At

I'm integrating Magento with a Ruby application and I'm using the XML-RPC API, but I'm facing an issue which I could only solve modifying Magento API code.

The thing is, I want to list the ProductAttribute but I need the "label" field comes along with the results The default API response does not include the 'label' field, which I need:

array
  0 =>
    array
      'attribute_id' => string '71' (length=2)
      'code' => string 'name' (length=4)
      'type' => string 'text' (length=4)
      'required' => string '1' (length=1)
      'scope' => string 'store' (length=5)

This would solve my problem if I had access to every Magento store I'm integrating with How to extend Magento API catalog_product.list to include more product information XML-RPC...

But I need to integrate with any Magento store and I don't have access to every Magento store server.

The integration should be transparent to the Magento store owner, the ideal would be having only the xml-rpc username and api key and consume their API, but since the API does not provide everything I need I'd need a practical solution, like installing an extension on every store that will integrate with my app. Which leads me to the following:

Is it possible to build a Magento extension which can expose a new API Endpoint that returns all the information I need? Or is there any other solution for this scenario?

1

There are 1 best solutions below

2
Guerra On

You can make a poolback file changing just the file you want, assume you can solve your problem using the solution of the link, the orientation is just to change some lines of the file: \app\code\core\Mage\Catalog\Model\Product\Api.php

You can create a module witch overrides this Model and make the job, you can create a new module with a new method of API to catch what you need, i'll explain some of this solutions: Creating a poolback, just take the file:

\app\code\core\Mage\Catalog\Model\Product\Api.php

And copy and put on:

\app\code\local\Mage\Catalog\Model\Product\Api.php

So you can change what you want, can pack it and send to your customers.

Can apply this solution creating a new API Model and new method check this link.

And finally overrides the Api model from product, check this link.