Php Api

Discussion in 'Developers Forum' started by datarater, Jul 18, 2008.

  1. datarater New Member

    I am building a PHP website and will want to use the KF API. Can anyone tell me how to do it?
  2. DuaneJackson Administrator

    It's been done before, so certainly do-able. I think you need to use something called nusoap (I'm not a PHP expert i'm afraid)
  3. datarater New Member

  4. websnail New Member

    Ah... I had to do some digging and look at specific examples of the API but the system uses SOAP transactions to handle everything in which case you could use SOAP by configuring it in your PHP build.

    Ref: http://uk3.php.net/manual/en/soap.installation.php

    If you're distributing an app that can be installed locally to an end users machine though then the nusoap library looks to be quite useful..
  5. Jeewhizz New Member

    nusoap should only be used for PHP 4.x. Seeing that most hosts now offer PHP 5.x, I would use the native PHP Soap functions within PHP 5 :)
  6. pratheesh New Member

    For those who are searching for php code :)
    The example below requires nusoap.php file

    PHP:
     
    <?php
    require_once('nusoap.php');
    $client = new soapclient('https://secure.kashflow.co.uk/api/service.asmx?WSDL','wsdl');
    $client->setDefaultRpcParams(true);
    $soapproxy $client->getProxy();
    $username "yourusername";
    $password "yourpassword";
    $arr = array('UserName'=>$username,'Password'=>$password,'CustomerCode'=>'somecustomercode');
    $result=$soapproxy->GetCustomer($arr);
    print_r($result); //the result returned is in form of an array
    ?>
  7. encabcompare New Member

    Thank You very much pratheesh, It's works for me.

Share This Page