I followed a lot of tutorials about how to extend Magento API but I didn't figure it out why I always get "Invalid api path." My goal is to extend Mage_Customer_Model_Customer_Api in order to add a new method to login a customer in site. I don't know if something like that is possible, but I need at least to be able to add a new method which just returns a message.
- Can someone provide me a link where I can find a working module which extends Magento API?
- Is it possible what I want to achieve? Thank you,
Yeee..I figured out "Invalid api path." error. Instead of calling
$result = $client->call($session_id, 'gw_base_order.createandcapture');
it has to be
$result = $client->call($session_id, 'resource_name.createandcapture');
Wrong tuturial: Extending Magento API and others like this.
I still need an answer for the second question.
-
Can I ask why you need a new login method? If you configure the API user correctly you can access all customer data. What are you trying to accomplish?user4351– user43512014年01月21日 07:45:23 +00:00Commented Jan 21, 2014 at 7:45
-
It is about a mobile application. I want to be able to login a customer through the mobile app.Denisa– Denisa2014年01月21日 15:47:41 +00:00Commented Jan 21, 2014 at 15:47
-
I haven't looked into the API permissions lately, but I don't recall there being a concept of "my orders". So I am not sure that once you succeed logging the customer in, that it will have a sensibele ACL associated with it. I think this problem needs solving first, because it is easier to change new user registration to add an API user, then creating a new login method.user4351– user43512014年01月21日 21:41:25 +00:00Commented Jan 21, 2014 at 21:41
-
I don't think I get what is your suggestion. I am trying to figure out for the moment how to login a customer in the site through extended API.Denisa– Denisa2014年01月21日 22:37:21 +00:00Commented Jan 21, 2014 at 22:37
-
1Please post your solution as answer for future visitors and accept it to close the question. Thanks!Sander Mangel– Sander Mangel2014年02月20日 11:34:05 +00:00Commented Feb 20, 2014 at 11:34
1 Answer 1
The functionality of logging users in to access their data from a mobile app for example is more a case for OAuth. You can read more about OAuth in Magento here and about the configuration here.
The API's are more meant to exchange information not tied to a specific user.