I want to use Magento Rest-Api to add custom data into Magento table. I have added one table into Magento db and created module with Rest API for that using following link
magento\app\code\core\Mage\Api2\Model\Resource.php is only allowed collection action type for create method.. so changed in api2.xml file and setup required fields in attribute tag
magento\app\code\community\MagePim\Extapi\etc\api2.xml
Custom API calls
My Api
extapi
extapi/api2
extapi/api2
Custom Api
1
1
1
1
Owner ID
Identity ID
Social ID
Status
Text
Request Time
Status Time
/scheduler
entity
/scheduler/create
collection
1
magento\app\code\community\MagePim\Extapi\Model\Api2\Rest\Admin\V1.php
/**
* Override for Magento's REST API
*/
class Magepim_Extapi_Model_Api2_Rest_Admin_V1 extends Mage_Api2_Model_Resource {
protected function _retrieve(){
return json_encode($shedulerData);
}
protected function _create($shedulerData){
return json_encode($shedulerData);
}
protected function _retrieveCollection(){
return json_encode(array('method'=>'_retrieveCollection'));
}
....................
}