title: How do I connect to external API from Magento
body: <p>I am looking for some assistance in creating an API based module to push customer information out of Magento into a Third party loyalty program.</p>
  
  <p>So far I have created a basic module but cannot find any good information on creating API based modules in Magento and could really do with some advice please...</p>
  
  <p>I need to somehow hook into the Checkout success page in Magneto and add a form the will POST the customers information (name, address etc) to a third party loyalty program. I also need to be able to login to complete the billing information etc...</p>
  
  <p>Does anyone know of any handy tutorials or documentation for such an implementation?</p>
  
  <p>So far I have setup an API user with the appropriate roles. I have also created a very basic module for test purpses but browsing to the file I get a 404 error</p>
  
  <p>apitest.php</p>
  
  <pre><code>&lt;?php 
  $proxy = new SoapClient('http://mysite.com/api/?wsdl'); //edit the address and put the url to your magento here
  
  $sessionId = $proxy-&gt;login('######', '#######'); // put in the info for your user here
  
  echo "Login ID : $sessionId";
  $result = $proxy-&gt;call($sessionId, 'Mymodule.testConnection', array('param1' =&gt; ' This string was sent from soap client'));
  echo $result; 
  </code></pre>
  
  <p>Objectmodel/api.php</p>
  
  <pre><code>&lt;?php
  class MyModule_MyModule_Model_ObjectModel_Api extends Mage_Api_Model_Resource_Abstract
  {
      public function testConnection($arg)
      {
          return "Hello World! My argument is : " . $arg;
      }
  }
  </code></pre>
  
  <p>I followed the example from <a href="http://bananacode.com.br/magento-custom-api-module-with-acl/" rel="nofollow">here</a> for getting a basic 'Hello world' module up and running if anyone could assist me with getting the correct setup I would be grateful</p>