1. The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you or to your Kayako. You can visit the forums for the new Kayako here.

PHP API Class - Replying to a Ticket

Discussion in 'Developing, APIs and extending' started by keliix06, Jul 23, 2012.

  1. keliix06

    keliix06 Established Member

    I'm having a little trouble getting the PHP API class to reply to a ticket. First I call

    Code:
    $ticket = kyTicket::get('***');
    $creator = kyUser::search('***');
    That code returns everything as expected.

    So then I call

    Code:
    kyTicketPost::createNew($ticket,$creator,'this is another reply');


    I know that's not set to send anything, I'm just testing what's returned. This is what I get





    So the creator isn't passed from what I can see. If I change it to
    Code:
    kyTicketPost::createNew($ticket,$creator,'this is another reply')->create();




    I get





    Enabled debugging, this is what I get

     
  2. keliix06

    keliix06 Established Member

    Just had an epiphany while looking at what was being returned. I changed the $creator line to

    Code:
    $creator = kyUser::search('***')->first();
    and it worked.
     

Share This Page