Magento Custom API: customer authentication

Magento is powerful estore system that support great feature that is not supporting by other e-store system. Magento support multi store that can be accessed from multi domain although it's installed in one domain. magento also support multi inventory for identical product. for example, we have cloth that different in size or colour. Magento can handle this product type.

as We know, by using Magento API we can make other application or other CMS to communicate with Magento system. we can access product list, customer list, invoice, shopping cart, etc. But Magento API just have admin authentication to authenticate API user to allow access to the API. we cannot make customer authentication using standart MAgento API.

Todd Wolaver make a note on his blog about how to make Api.php file that can be used as customer authentication. you can see his blog at http://todd.be/notes/magento-customer-login-api. but he did not specify how to make this custom plugin working. Magento API documentation also did not make clear documentation how to make custom API. documentation at http://www.magentocommerce.com/wiki/doc/webservices-api/custom-api is not enought for newbi person to make new custom API. Here's my experience on implementing this Custom API.

1. make CompanynameModulename.xml and save it to /app/etc/module/CompanynameModulename.xml
2. Make api.xml and placed in app/code/local/Companyname/Modulename/etc/api.xml
This file will contain all information of your custom API. all method that used have to be specified in this file.
3.make config.php and placed it to app/code/local/Companyname/Modulename/etc/config.xml to store your configuration.
4. make Api.php and save it to app/code/local/Companyname/Modulename/Model/Api.php or app/code/local/Companyname/Modulename/Model/ObjectModel/Api.php
This is the main API file that we described the functionality at api.xml
5. Call our custom API.

Related post