Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Soap

124

Comments

  • Not compatible with osTicket 1.7RC3

    I was not having any success calling ostTicket.getMessages, or ostTicket.open (there may be more, these are among the few I've tried).

    I realised this is due to different db table structure used in v1.7. I've managed to hack together a fix for getMessages, but ostTicket.open is a little more challenging.

    If anyone has successfully adapted this mod for 1.7 please drop me a line, for now i'm rolling back to 1.6.

    Great mod, very useful and saved me a lot of time. Thank you thank you

    File attachment support would be even more appreciated :p
  • assign function

    browsing the code ive noticed a Assing function which is not shown in the documentation, does it work?
  • Thank you

    Just wanted to say thank you for your efforts in creating this mod.
  • bkonia;22663 said:
    I updated the API to add support for all available fields when opening a ticket. The new fields supported are:

    * deptId
    * source
    * duedate
    * time
    * pri (this was an existing field, but there was a bug that I fixed)

    You can also now pass three additional parameters to the open method:

    origin, autorespond, alertstaff

    The origin parameter allows you to specify the origin of the ticket (web, email, or staff). This is needed for the next part of the update, which was to add support for creating staff tickets:

    If you set origin=staff, then the open method in the API will call the create_by_staff method instead of the regular create method.

    In order for this to work, you must include an additional field called "issue" in the ticketData array that you pass to the API. The issue field replaces the message field used by the regular open method, since staff tickets override the message field. However, you still have to send a blank message field, or the API will reject the submission.

    You can also use the following additional fields when creating a staff ticket:

    * staffId
    * alertuser
    * alertstaff

    This update required changes to index.php and ticket.class.php. I've attached a ZIP file containing the updates and all the changes are commented with my initials: //BSK
    Sorry, i can´t change my deptId, it always create a new ticket with deptId=1

    $args = array(
    'username' => 'xxx',
    'password' => 'yyy',
    'ticketData' => array(
    'name' => utf8_encode('sir Test'),
    'email' => $email,
    'subject' => utf8_encode('testing'),
    'message' => utf8_encode('this is a message'),
    'topicId' => 3, //topic Website Support
    'pri' => 2, // default priority
    'deptId' => 3, //añadido ahora
    'phone' => '012-345678'
    )
    );

    thanks a lot for the MOD, is fantastic for me!!!!!!
  • Hi all,

    apparently I wasn't receiving notifications of replies anymore so my apologies for the late response.
    dinie;29663 said:
    I was not having any success calling ostTicket.getMessages, or ostTicket.open (there may be more, these are among the few I've tried).

    I realised this is due to different db table structure used in v1.7. I've managed to hack together a fix for getMessages, but ostTicket.open is a little more challenging.

    If anyone has successfully adapted this mod for 1.7 please drop me a line, for now i'm rolling back to 1.6.

    Great mod, very useful and saved me a lot of time. Thank you thank you

    File attachment support would be even more appreciated :p
    Thank you for you reply, I will have a look at this soon and make sure it will work with the latest osTicket.
    rnrstar;33644 said:
    Just wanted to say thank you for your efforts in creating this mod.
    Thank you very much :)
    andrewtite;33843 said:
    Does this work with 1.7 I just installed??

    Trying to see if I can use this to integrate eBay API Messages.
    Last time I checked it worked, but I have seen some repleis there are some issues, I will look into those.
    Arenas;34002 said:
    Sorry, i can´t change my deptId, it always create a new ticket with deptId=1

    $args = array(
    'username' => 'xxx',
    'password' => 'yyy',
    'ticketData' => array(
    'name' => utf8_encode('sir Test'),
    'email' => $email,
    'subject' => utf8_encode('testing'),
    'message' => utf8_encode('this is a message'),
    'topicId' => 3, //topic Website Support
    'pri' => 2, // default priority
    'deptId' => 3, //añadido ahora
    'phone' => '012-345678'
    )
    );

    thanks a lot for the MOD, is fantastic for me!!!!!!
    Which osTicket version are you using? So whenever you create a ticket with a different deptId it always reverst to deptId = 1?
  • @bkonia, I have integrated your additions and have changed some to make them work. Thank you for your input! I will update the documentation on the website and once that has been done I will upload the latest new version.

    Then it's time to make the MOD fully compatible with the latest osTicket :)

    [edit]
    New version online @ http://www.cyberde.nl/software-en-US/osticket-soap-mod/

    @Arenas, can you try with this version (it includes the changes from bkonia but a little different and working now)
  • mikeymikey;29121 said:
    I have been testing for a few hours, I can't seem to be able to choose which department to open the ticket in.. it always defaults to the default department.

    I even downloaded and updated my code from a contributor that added depId and I tried that but no luck there too..

    Below is an example:

    $args = array(
    'username' => 'username',
    'password' => 'password',
    'ticketData' => array(
    'name' => utf8_encode($_POST['name']),
    'email' => utf8_encode($_POST['email']),
    'subject' => utf8_encode($_POST['subject']),
    'message' => utf8_encode($_POST['message']),
    'depId' => 5,
    'pri' => 3,
    'phone' => utf8_encode($_POST['phone']),
    'topicId' => 2,
     )

     );
    Hi mikeymikey, the problem should be solved in the new version I am currently working on (also already in the one released on my website today).
    dinie;29663 said:
    I was not having any success calling ostTicket.getMessages, or ostTicket.open (there may be more, these are among the few I've tried).

    I realised this is due to different db table structure used in v1.7. I've managed to hack together a fix for getMessages, but ostTicket.open is a little more challenging.

    If anyone has successfully adapted this mod for 1.7 please drop me a line, for now i'm rolling back to 1.6.

    Great mod, very useful and saved me a lot of time. Thank you thank you

    File attachment support would be even more appreciated :p
    I am currently looking into this one, I'm making sure the 1.7 version will also be supported in the same MOD. If you are able to test the rest of the functions and report back which ones don't work, I can immediately look into it :)

    [edit]
    getMessages and getMessagesFromDate are now working.

    [edit2]
    The new version, WITH support for osTicket 1.7, is now available at http://www.cyberde.nl/software-en-US/osticket-soap-mod/
  • Xml

    Hello im trying to get your MOD working correctly and im having trouble. When I try and open a new ticket here is the error im getting

    Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in /home/matest/public_html/sandbox/junkcars/add.php:25 Stack trace: #0 /home/matest/public_html/sandbox/junkcars/add.php(25): SoapClient->__call('ostTicket.open', Array) #1 {main} thrown in /home/matest/public_html/sandbox/junkcars/add.php on line 25


    Here is the code im using to add

    <?php
    $osticket = new SoapClient('api/soap/index.php?wsdl');

    // Set up the parameters
    $args = array(
    'username' => 'admin1',
    'password' => 'xxx',
    'ticketData' => array(
    'name' => utf8_encode('sir Test'),
    'email' => utf8_encode('some@email.com'),
    'subject' => utf8_encode('testing'),
    'message' => utf8_encode('this is a message'),
    'topicId' => 1, //topic Website Support
    'deptId' => 1, //department Sales
    'staffId' => null,
    'duedate' => null,
    'time' => null,
    'pri' => 2, // default priority
    'phone' => null,
    )
    );

    try {
    // Send the request and receive the ticketID
    $result = $osticket->__call('ostTicket.open',$args);
    }
    catch (SoapFault $e) {
    throw $e;
    }
    ?>


    And when I try and run this I get a warning log in my admin panel saying

    SOAP: openTicket failed
    Opening a ticket from 22.33.144.145 failed

    Not really sure what im doing wrong at this point. Im using osticket 1.7

    Any help would be greatly appreciated!
  • Does this mod works with 1.6 RC4? cause im getting errors like: Fatal error: Uncaught SoapFault exception: [HTTP] Internal Server Error
    Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://it-eserv...', 'http://it-eserv...', 1, 0) #1
    SoapClient->__call('ostTicket.reope...', Array) #2 {main} thrown in
    this line: if ($osticket->__call('ostTicket.reopen',$args)) {

    This happend when i try to close, reopen a ticket (it works but shows this error)
    almost all ostTicket.* methods throw me that error and i dont know why is it the osticket version?
  • akobrandon;34601 said:
    Hello im trying to get your MOD working correctly and im having trouble. When I try and open a new ticket here is the error im getting

    Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in /home/matest/public_html/sandbox/junkcars/add.php:25 Stack trace: #0 /home/matest/public_html/sandbox/junkcars/add.php(25): SoapClient->__call('ostTicket.open', Array) #1 {main} thrown in /home/matest/public_html/sandbox/junkcars/add.php on line 25
    Here is the code im using to add

    <?php
    $osticket = new SoapClient('api/soap/index.php?wsdl');
    And when I try and run this I get a warning log in my admin panel saying

    SOAP: openTicket failed
    Opening a ticket from 22.33.144.145 failed

    Not really sure what im doing wrong at this point. Im using osticket 1.7

    Any help would be greatly appreciated!
    You need to supply the full address to the wsdl (not just a relative path).
    Eg http://www.yourwebsite.com/support/api/soap/index.php?wsdl
  • ozkr;35021 said:
    Does this mod works with 1.6 RC4? cause im getting errors like: Fatal error: Uncaught SoapFault exception: [HTTP] Internal Server Error
    Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://it-eserv...', 'http://it-eserv...', 1, 0) #1
    SoapClient->__call('ostTicket.reope...', Array) #2 {main} thrown in
    this line: if ($osticket->__call('ostTicket.reopen',$args)) {

    This happend when i try to close, reopen a ticket (it works but shows this error)
    almost all ostTicket.* methods throw me that error and i dont know why is it the osticket version?
    It should work from version 1.6 to 1.7 of osTicket. I have not tested 1.6 RC4.
  • Thanks! i works nice with 1.6 and 1.7.

    Can i use jquery to access the api?

    $getJSON(url, data, callback)

    how can i send the username, password and status or what ever i ask the api with jquery?
    can i send the the arguments in the url?
  • ozkr;35489 said:
    Thanks! i works nice with 1.6 and 1.7.

    Can i use jquery to access the api?

    $getJSON(url, data, callback)

    how can i send the username, password and status or what ever i ask the api with jquery?
    can i send the the arguments in the url?
    No you can't, it's a SOAP service. Unless you use some sort of jquery soap library (I don't know if those exist), or you write some php (or whatever) pages that call the soap service and convert the result data to json. Which you then call from jquery.
  • "source" property

    When using this mod with osTicket 1.7 it is required to set both "origin" and "source". What exactly should I put in here, so that e.g. created tickets show up with the orange W icon in the ticket list?

    Eric
  • Works with 1.7?

    Does this work with 1.7?
    I really want to use these features to use with OpenCart website.
  • I'm getting this error when I upload the files and try the code example from your site.

    Fatal error: Class 'SoapClient' not found in /hermes/bosoraweb041/b1672/ipg.3gmusicandsoundca/solomusicgear.ca/support/test1.php on line 5

    Here is my code:

    <?php
    error_reporting(E_ALL);
    ini_set('display_errors', '1');

    $osticket = new SoapClient('http://www.solomusicgear.ca/support/api/soap/index.php?wsdl');

    // Set up the parameters
    $args = array(
    'username' => 'username',
    'password' => 'password',
    'origin' => 'Web',
    'alertuser' => true,
    'alertstaff' => true,
    'ticketData' => array(
    'name' => utf8_encode('Joe Tester'),
    'email' => utf8_encode('joe@tester.com'),
    'subject' => utf8_encode('The Subject of the matter'),
    'message' => utf8_encode('Some message for you'),
    'topicId' => 1,
    'deptId' => 1,
    'staffId' => null,
    'dueDate' => null,
    'time' => null,
    'pri' => 2,
    'phone' => null,
    )
    );

    try {
    // Send the request and receive the ticketID
    $result = $osticket->__call('ostTicket.open',$args);
    }
    catch (SoapFault $e) {
    throw $e;
    }

    ?>
  • akobrandon;34601 said:


    Here is the code im using to add

    <?php
    $osticket = new SoapClient('api/soap/index.php?wsdl');

    // Set up the parameters
    $args = array(
    'username' => 'admin1',
    'password' => 'xxx',
    'ticketData' => array(
    'name' => utf8_encode('sir Test'),
    'email' => utf8_encode('some@email.com'),
    'subject' => utf8_encode('testing'),
    'message' => utf8_encode('this is a message'),
    'topicId' => 1, //topic Website Support
    'deptId' => 1, //department Sales
    'staffId' => null,
    'duedate' => null,
    'time' => null,
    'pri' => 2, // default priority
    'phone' => null,
    )
    );

    try {
    // Send the request and receive the ticketID
    $result = $osticket->__call('ostTicket.open',$args);
    }
    catch (SoapFault $e) {
    throw $e;
    }
    ?>


    And when I try and run this I get a warning log in my admin panel saying

    SOAP: openTicket failed
    Opening a ticket from 22.33.144.145 failed

    Not really sure what im doing wrong at this point. Im using osticket 1.7

    Any help would be greatly appreciated!
    Got the exact same error.
    Came from the fact that I had forgotten to add new parameters :

    'alertuser' => true,
    'alertstaff' => true,

    Sample here : http://www.cyberde.nl/software-en-US/osticket-soap-mod/

    You can also check error-log file in your SOAP folder for further details about the error. That's how I found my mistake.

    Regards,
    Allan

    P.S. Btw, thank you Cyberde for this great contribution ! :)
  • You can also check error-log file in your SOAP folder for further details about the error. That's how I found my mistake.
    How did you enable this log Allan?

    This code below appears to work for me when tested with this service http://www.soapclient.com/soaptest.html .... but I'm not sure how I actually get and output the result?

    :confused:

    // Set up the parameters
    $args = array(
    'username' => 'user',
    'password' => 'pass',
    'status' => 'open',
    );

    try {
    // Send the request and receive the status (eg Open, Closed)
    $result = $osticket->__call('ostTicket.listByStatus',$args);

    }
    catch (SoapFault $e) {
    throw $e;
    }
  • Error: Cannot use object of type Ticket as array in ticket.class.php

    Any help will be appreciate:

    I am trying to get messages from one specific ticket, with this function:

    http://www.cyberde.nl/software-en-US/osticket-soap-mod/ostticket-getmessages/

    I get this error in error_log:
    PHP Fatal error: Cannot use object of type Ticket as array in ticket.class.php on line 270

    This is line 270
    if (isVersion('1.7'))
    {
    if($thread = $ticket->getThread(false)) {
    $message = null;

    foreach($thread as $entry) {
    ->270 switch ($entry['thread_type'])
    {
    case 'M':
    if ($message != null)
    $messages[] = $message;


    I am using version 1.7

    Thanks in advaced
  • Beginner Tutorial/Demo will be very helpful

    I am trying to connect osticket support system with opencart. I tried to integrate with this SOAP

    <?php
    error_reporting(E_ALL);
    ini_set('display_errors', '1');

    $osticket = new SoapClient('http://www.website.com/osticket/api/soap/index.php?wsdl');

    // Set up the parameters
    $args = array(
    'username' => 'WebService',
    'password' => 'MySecr3tp@ssword',
    'origin' => 'Web',
    'alertUser' => true,
    'alertStaff' => true,
    'ticketData' => array(
    'name' => utf8_encode('sir Test'),
    'email' => utf8_encode('some@email.com'),
    'subject' => utf8_encode('testing'),
    'message' => utf8_encode('this is a message'),
    'topicId' => 3, //topic Website Support
    'deptId' => 2, //department Sales
    'staffId' => null,
    'duedate' => null,
    'time' => null,
    'pri' => 2, // default priority
    'phone' => null,
    )
    );

    try {
    // Send the request and receive the ticketID
    $result = $osticket->__call('ostTicket.open',$args);
    }
    catch (SoapFault $e) {
    throw $e;
    }
    ?>
    The error I get is

    Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object hasn't 'source' property in /home/website/website.com/catalog/view/theme/testtheme/template/information/contact.tpl:60
    Stack trace:
    #0 /home/website/website.com/catalog/view/theme/testtheme/template/information/contact.tpl(60): SoapClient->__call('ostTicket.open', Array)
    #1 /home/website/website.com/vqmod/vqcache/vq2-system_engine_controller.php(67): require('/home/website/tu...')
    #2 /home/website/website.com/catalog/controller/information/contact.php(127): Controller->render()
    #3 /home/website/website.com/vqmod/vqcache/vq2-system_engine_front.php(43): ControllerInformationContact->index()
    #4 /home/website/website.com/vqmod/vqcache/vq2-system_engine_front.php(29): Front->execute(Array, Array)
    #5 /home/website/website.com/index.php(238): Front->dispatch(Object(Action))
    #6 {main} thrown in/home/website/website.com/catalog/view/theme/testtheme/template/information/contact.tpl on line 60

    Here is the line 60 (/template/information/contact.tpl):
    $result = $osticket->__call('ostTicket.open',$args);

    I'd be grateful if anyone kindly help me in this issue.

    SOAP Info
    This is from phpinfo

    Soap Client enabled
    Soap Server enabled

    Directive Local Value Master Value
    soap.wsdl_cache 1 1
    soap.wsdl_cache_dir /tmp /tmp
    soap.wsdl_cache_enabled 1 1
    soap.wsdl_cache_limit 5 5
    soap.wsdl_cache_ttl 86400 86400
  • 500 Internal Server Error on host but locally working fine

    I have a problem when running the web service on my host (InMotion), I get a 500 Internal Server Error and the server log mention a Premature end of script header. I've check with my host and they say the problem is with my script. what I don't understand is that the script work fine when I run it locally. Here's the script:
    <?php
    // Connect to the web service
    $osticket = new SoapClient('http://www.mysite.com/support/api/soap/index.php?wsdl');

    // Set up the parameters
    $args = array(
    'username' => 'myusername',
    'password' => 'mypassword',
    'ticketId' => 280197);

    // Send the request and receive the status (eg Open, Closed)
    $result = $osticket->__call('ostTicket.getStatus',$args);
    echo $result;
    ?>


    I'm new to PHP, server and all. Anybody would have some indication on how to debug this or find exactly why locally the service works but not on the hosting site? I really need this to work

    By the way, great work for this web service. It brings OsTicket to an all new level.
    learn;39023 said:

    The error I get is

    Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object hasn't 'source' property in /home/website/website.com/catalog/view/theme/testtheme/template/information/contact.tpl:60
    I believe you are only missing the 'source' parameter. See index.php for list of parameter.
  • andrewtite;38282 said:
    Does this work with 1.7?
    I really want to use these features to use with OpenCart website.
    Yes it does :)
    andrewtite;38294 said:
    I'm getting this error when I upload the files and try the code example from your site.

    Fatal error: Class 'SoapClient' not found in /hermes/bosoraweb041/b1672/ipg.3gmusicandsoundca/solomusicgear.ca/support/test1.php on line 5

    ?>
    It looks like your Soap extension for PHP isn't enabled.
    AllanKikker;38829 said:

    P.S. Btw, thank you Cyberde for this great contribution ! :)
    You're welcome :)
  • Wordpress seems to be causing my problem

    I've tryed on a different host and the web service works fine but after installing WordPress I get the following error:

    Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.bbjtesting.web44.net/support/api/soap/index.php?wsdl' : Extra content at the end of the document in /home/a6647477/public_html/bbjtesting_file.php:3 Stack trace: #0 /home/a6647477/public_html/bbjtesting_file.php(3): SoapClient->SoapClient('http://www.bbjt...') #1 {main} thrown in /home/a6647477/public_html/bbjtesting_file.php on line 3

    So it seems like WordPress is the problem. Not sure where to look next, anybody would have an idea?
  • after extracting all files in localhost/osticket/api/soap

    All I see is this

    osTicket Webservice v1.5-56 - by CYBERDE Solutions (www.cyberde.nl)

    View the WSDL for the service. Click on an operation name to view it's details.

    ostDepartment.getInfo
    ostDepartment.listAll
    ostTicket.assign
    ostTicket.close
    ostTicket.delete
    ostTicket.getInfo
    ostTicket.getMessages
    ostTicket.getMessagesFromDate
    ostTicket.getNotes
    ostTicket.getStatus
    ostTicket.listByStatus
    ostTicket.listFromDate
    ostTicket.open
    ostTicket.postMessage
    ostTicket.postNote
    ostTicket.postReply
    ostTicket.release
    ostTicket.reopen
    ostStaff.getInfo
    ostStaff.listAll
    ostTopic.getInfo
    ostTopic.listAll

    And when I click on the:

    http://localhost/osticket/api/soap/index.php?wsdl

    All I get is

    This XML file does not appear to have any style information associated with it. The document tree is shown below.


    then the codes display here.....

    can anyone help me?
    thank you
  • david.landry;39391 said:
    I have a problem when running the web service on my host (InMotion), I get a 500 Internal Server Error and the server log mention a Premature end of script header. I've check with my host and they say the problem is with my script. what I don't understand is that the script work fine when I run it locally. Here's the script:
    <?php
    // Connect to the web service
    $osticket = new SoapClient('http://www.mysite.com/support/api/soap/index.php?wsdl');

    // Set up the parameters
    $args = array(
    'username' => 'myusername',
    'password' => 'mypassword',
    'ticketId' => 280197);

    // Send the request and receive the status (eg Open, Closed)
    $result = $osticket->__call('ostTicket.getStatus',$args);
    echo $result;
    ?>


    I'm new to PHP, server and all. Anybody would have some indication on how to debug this or find exactly why locally the service works but not on the hosting site? I really need this to work

    By the way, great work for this web service. It brings OsTicket to an all new level.


    I believe you are only missing the 'source' parameter. See index.php for list of parameter.
    Just found the problem, SOAP module wasn't activated in the PHP.ini file. Now it works!
  • arielchiong;39679 said:
    after extracting all files in localhost/osticket/api/soap

    All I see is this

    osTicket Webservice v1.5-56 - by CYBERDE Solutions (www.cyberde.nl)

    View the WSDL for the service. Click on an operation name to view it's details.

    ostDepartment.getInfo
    ostDepartment.listAll
    ostTicket.assign
    ostTicket.close
    ostTicket.delete
    ostTicket.getInfo
    ostTicket.getMessages
    ostTicket.getMessagesFromDate
    ostTicket.getNotes
    ostTicket.getStatus
    ostTicket.listByStatus
    ostTicket.listFromDate
    ostTicket.open
    ostTicket.postMessage
    ostTicket.postNote
    ostTicket.postReply
    ostTicket.release
    ostTicket.reopen
    ostStaff.getInfo
    ostStaff.listAll
    ostTopic.getInfo
    ostTopic.listAll

    And when I click on the:

    http://localhost/osticket/api/soap/index.php?wsdl

    All I get is

    This XML file does not appear to have any style information associated with it. The document tree is shown below.


    then the codes display here.....

    can anyone help me?
    thank you
    Hi arielchiong,
    That's how it's suppost to work. I'm guessing you are visiting it with Firefox? This is normal behaviour telling you it's a valid XML document but has no stylesheet (which we don't need of course cause it's just plain XML for SOAP).

    Have a look at the examples on my site on how to use this MOD
    david.landry;40010 said:
    Just found the problem, SOAP module wasn't activated in the PHP.ini file. Now it works!
    Hi David,

    I was just about to answer your question but you have figured out yourself :)

    Enjoy
  • [QUOTE=cyberde;40016]Hi arielchiong,
    That's how it's suppost to work. I'm guessing you are visiting it with Firefox? This is normal behaviour telling you it's a valid XML document but has no stylesheet (which we don't need of course cause it's just plain XML for SOAP).

    Have a look at the examples on my site on how to use this MOD


    I see.. but can you guide me on how Im going to make the soap mod work?

    when I click on the LINKS nothing happens and it only shows the description.

    please help me sorry for this I just a newbie here.
  • arielchiong;40034 said:
    [QUOTE=cyberde;40016]Hi arielchiong,
    That's how it's suppost to work. I'm guessing you are visiting it with Firefox? This is normal behaviour telling you it's a valid XML document but has no stylesheet (which we don't need of course cause it's just plain XML for SOAP).

    Have a look at the examples on my site on how to use this MOD


    I see.. but can you guide me on how Im going to make the soap mod work?

    when I click on the LINKS nothing happens and it only shows the description.

    please help me sorry for this I just a newbie here.
    That's because what you see, when you visit the soap mod, is the service description. You need to call it with a soap client (eg SoapClient in PHP, or the webservices client in Visual Studio). Hence I suggested you have a look at the samples on my website (open ticket example here: http://www.cyberde.nl/software-en-US/osticket-soap-mod/ostticket-open/)

    Also have a look at this tutorial: http://www.vankouteren.eu/blog/2009/03/simple-php-soap-example/
  • open ticket not working with C#

    Hi,
    I'm trying to get this mod working with an ASP.NET/C# app. I can get the connection going, but opening a ticket fails. I know all examples here are in php, but I was hoping someone might have an idea of what I'm doing wrong. Here's my code:

    OSTicketRef.TicketData ticketData = new TicketData();
    osTicketWebservicev1556 ticket = new osTicketWebservicev1556();

    ticketData.name = TextBoxName.Text.ToString();
    ticketData.email = TextBoxEmail.Text.ToString();
    ticketData.subject = TextBoxSubject.Text.ToString();
    ticketData.message = TextBoxMessage.Text.ToString();
    ticketData.topicId = 1;
    ticketData.deptId = 1;
    ticketData.staffId = 2;
    ticketData.duedate = DateTime.Now;
    ticketData.time = DateTime.Now;
    ticketData.pri = 2;
    ticketData.phone = "00";

    int ticketID = ticket.ostTicketopen("user", "pass", "web", false, false, ticketData);

    The only error I get is [SoapException: openTicket failed], which the osTicket log also shows.
    Am I missing a parameter (I followed the examples on the mod's website)?

    many thanks in advance!
  • I got problems, too:

    I try to open a new ticket through the SOAP-API.
    This is my code:

    $args = array('username' 	=> 'username',
    'password' => 'password',
    'origin' => 'RRCenter',
    'autorespond' => true,
    'alertstaff' => true,
    'ticketData' => array( 'name' => utf8_encode('sir Test'),
    'email' => utf8_encode('some@email.com'),
    'subject' => utf8_encode('testing'),
    'message' => utf8_encode('this is a message'),
    'topicId' => 1, //topic Website Support
    'deptId' => 1, //department Sales
    'staffId' => null,
    'duedate' => null,
    'time' => null,
    'pri' => 2, // default priority
    'phone' => null,
    'alertuser' => true,
    'alertstaff'=> true,
    'source' => 'Test',
    )
    );

    try {
    // Send the request and receive the ticketID
    $result = $osticket->__call('ostTicket.open',$args);

    }
    catch (SoapFault $e) {
    throw $e;
    }


    But I always get the error:
    Fatal error: Uncaught SoapFault exception: [SERVER] openTicket failed in {...}tickets.php:74 Stack trace: #0 
Sign In or Register to comment.