Forums



Closed Thread
Results 1 to 5 of 5

Thread: Looking for php example code

  1. #1
    Peter Bowen is offline Junior Member
    Join Date
    Nov 2008
    Posts
    15

    Default Looking for php example code

    Greetings,

    I'm hoping that someone is kind enough to share an example of a php API integration. It's always much faster to get started on standing on the shoulders of giants.

    Cheers

    Pete
    No more slow paying clients >>www.getting-paid.com

  2. #2
    Peter Bowen is offline Junior Member
    Join Date
    Nov 2008
    Posts
    15

    Default

    I figured out I'd have to just battle it out myself.

    So here is my first attempt at retrieving an invoice.

    PHP Code:
    <?php
    //this is test-kf.php

    $client = new SOAPClient("https://secure.kashflow.co.uk/api/service.asmx?WSDL");
        
    $invoice $client->__soapCall('GetInvoice',array('Username'=>'xxxx','Password'=>'xxx','InvoiceNumber'=>'1'));
        
    print_r($invoice);
        
    ?>
    It's connecting fine but doesn't authenticate me? I've done the obvious and rechecked the username and password combo.

    Here is the error message

    stdClass Object ( [GetInvoiceResult] => stdClass Object ( [InvoiceDBID] => 0 [InvoiceNumber] => 0 [InvoiceDate] => 0001-01-01T00:00:00 [DueDate] => 0001-01-01T00:00:00 [CustomerID] => 0 [Paid] => 0 [Lines] => stdClass Object ( ) [NetAmount] => 0 [VATAmount] => 0 [AmountPaid] => 0 ) [Status] => NO [StatusDetail] => An exception occured whilst trying to authenticate you. String reference not set to an instance of a String. Parameter name: s )

    I've tried all the combinations of UserName and InvoiceNumber vs InvNumber as shown in the manual and the example code with no luck.

    Any ideas?

    Cheers

    Pete
    No more slow paying clients >>www.getting-paid.com

  3. #3
    DuaneJackson is offline Administrator
    Join Date
    Jun 2008
    Posts
    153

    Default

    Hi Pete,

    For show stopping erros like this you should contact us on support AT or api AT kashflow.co.uk.

    Tomorrow I'll be able to edit the API to give more detail with that error, then when you get the error again you'll have more detail to send us which should allow us to fix it.
    KashFlow Founder & CEO
    Note: For a fast response to support queries, click the 'Help' tab in your KashFlow account.
    These forums are not intended for dealing with support queries.

  4. #4
    Peter Bowen is offline Junior Member
    Join Date
    Nov 2008
    Posts
    15

    Default

    Thanks Duane,

    I'll do that next time. Waint - hopefully there won't be a next time.

    Cheers

    Pete
    No more slow paying clients >>www.getting-paid.com

  5. #5
    DuaneJackson is offline Administrator
    Join Date
    Jun 2008
    Posts
    153

    Default

    So that we don't have two threads on the same problem, I'm locking this one.

    Thread continued at integrating with php
    KashFlow Founder & CEO
    Note: For a fast response to support queries, click the 'Help' tab in your KashFlow account.
    These forums are not intended for dealing with support queries.

Closed Thread

Similar Threads

  1. Post Code Lookup
    By celtictuning in forum Suggestions
    Replies: 0
    Last Post: 15th May 2010, 09:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts