Craig Brass Systems Forum: ticketSubmit issue - Craig Brass Systems Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

ticketSubmit issue

#1
User is offline   Matt 

  • Member
  • Pip
  • Group: Members
  • Posts: 23
  • Joined: 24-October 08
I have been using submitTicket thru the SOAP for a while and have received plenty of complaints that the are getting an error message (from my software) even though the ticket is actually submitted. I tried using print_r on the $ticket and all I get is 1. Is there something I am doing wrong or a bug in the code? Here is my partial code:

CODE
    $params = array('user' => $APIusername,
                    'password' => md5($APIpassword),
                    //Email address of the Kayako user to get tickets for
                    'email' => $user->getEmail(),
                    'departmentId' => 1,
                    'priorityId' => 1,
                    'fullName' => $user->getName(),
                    'subject' => $_POST['subject'],
                    'message' => $_POST['message'],
                    'sendAuto' => true,
                    'passType' => 1,
                    'pass' => $user->getPassword()
                    );

    $ticket = call('submitTicket', $params);
    if(is_numeric($ticket['id']))
    {
                echo 'Thanks support ticket submitted etc...';
        }
    else
    {
                echo 'Error. ticket not submitted...';
        }

0

#2
User is offline   Andrew Gillard 

  • Staff - Lead Developer
  • Pip
  • Group: Developers
  • Posts: 97
  • Joined: 04-March 07
  • Gender:Male
  • Location:Basingstoke, United Kingdom
You say the error message is from your software... If print_r() is saying 1, the return value is probably TRUE - i.e. successful ticket submission. So are you failing to correctly interpret the return value of that function, or have I misunderstood what you're saying?
Andrew Gillard
Lead Developer - Craig Brass Systems
0

#3
User is offline   Matt 

  • Member
  • Pip
  • Group: Members
  • Posts: 23
  • Joined: 24-October 08
Understood correctly.... however your documentation says it should return something different if its successful (reason why I check if ticket['id'] is numeric):
CODE
Successful submission:

array(2) {
  ["id"]=>
  int(1)
  ["mask"]=>
  string(10) "ABC-123456"
}

0

#4
User is offline   Andrew Gillard 

  • Staff - Lead Developer
  • Pip
  • Group: Developers
  • Posts: 97
  • Joined: 04-March 07
  • Gender:Male
  • Location:Basingstoke, United Kingdom
Hmm. I'm not really sure. The documentation matches the code, so that's correct, but I don't see why you would be getting that information from print_r(). Would you mind using var_dump() on the output instead, please? That gives much more accurate information (i.e. the type - int/bool/etc. - not just the value).

It may also help if I can see your call() function.
Andrew Gillard
Lead Developer - Craig Brass Systems
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users