Great news that the API-documentation has been released. We are trying to integrate Magento using XML-RPC as we dont have any SoapClient available in our programming-language, but we’d really like to see some more examples on using XML-RPC.
Has anyone tested XML-RPC with Magento and got some examples to share? From “LoginResponse” to “ShowResources” to the Results themselves.
1. Install Magento 1.1 (minimum)
2. In the admin, under System -> Web Services, add one user, add one role (specify the access level for the role, or check “All"), and assign the user to the role
3. Using a XML RPC client (a good one for Mac OS X: http://ditchnet.org/xmlrpc/), set the endpoint URL to http://yourstore/magento/api/xmlrpc/
4. First call the method “login”, with 2 parameters: the user and the key (you just created them at step 2.). Refer to the screenshot in attachement.
5. The request looks like this:
7. Using the session id you are now able to call any other method. For example catalog_category.tree. So you just always call the method “call” and pass the 2 parameters: session id, method name (refer to screenshots in attachement). You may have other parameters to pass depending on the target method.
I downloaded the Magento 1.1.1 version and tried exactly what you told (and what the new doc says). But unfortunately, it looks like the XML/RPC server isn’t found. I’m getting a 404 HTTP error both from my Firefox browser or my Python xmlrpclib client. Same error occurs on my colleague Magento 1.1.1 fresh install too.
I’ve got Magento installed at: http://localhost/magento and the URL I’m using for my XML/RPC client is http://localhost/magento/api/xmlrpc/
Also notice that I’m getting a 404 error as well when browsing http://localhost/magento/api/?wsdl
Is there some hack I should do to get the standard XML/RPC server working?
Also please consider this is important, we just released a Magento extension to connect Magento to the famous OpenERP ERP but we used the crappy xmlrpc.inc wich seems really targeted for PHP 4 because you released your API documentation only very recently. So we would be API to use the native Magento API instead (tracker here: http://code.google.com/p/magento-openerp-smile-synchro/issues/detail?id=3 )
So I suggest the Magento team update their doc to reflect that URL change. Thank you again.
So yeah, we’ll hopefully irmprove our connector module very soon.
When looking at the API doc e.g. customer.create it says in the parameter array (country, zip, city, etc...) but where do I find the exact listing of paramters and their order?
I get the same errors as roefe - fault code 623 and “Calling parameters do not match signature”. Probably something has changed in the recent Magento releases that keep this from working.
when i try to login using the information above XML-RPC client seems to work just fine - i put in my login information hit execute and it tells me that it was executed in .75 seconds - but i get nothing in the XML Response tab - i have checked my server error logs and there is nothing there either. Can someone please shed some light on this situation?
I am also trying the magento’s xml-rpc api.
However the situation is quite different.
I am implementing it on a php4.4 server, this means running magento on cgi-bin library.
The other trouble is magento is running alongside dolphin and I am required to run them together.
Cut the long story short, I have used xmlrpc for php (http://sourceforge.net/projects/phpxmlrpc/) and after some trial and error succeeded in adding a customer using xml-rpc call and can see the customer record in admin section.
However, that customer is not able to login saying
‘Invalid login or password.’
And when I clicked the forget your password link and entered the email address, magento replies
‘This email address was not found in our records’.
This means that, either the created record is not functional, or it is in wrong data type.