1 Reply Latest reply on Nov 17, 2014 10:28 PM by matt_in_slo

    Updating tickets in WHD using JavaScript

    mkubala

      I'm trying to create a web form which would allow me to update WHD tickets using WHD's REST service. I found the documentation for the WHD API (http://www.solarwinds.com/documentation/WebHelpDesk/docs/WHD_API_12.1.0/Web%20Help%20Desk%20API.html), but all the examples are using a shell script. I was wondering if there was any info on using JavaScript instead. I have the following JQuery code in my script which should update a ticket's subject, but even though it runs successfully, nothing is changed in the ticket.

      $.ajax({
      url:
      http://webhelpdesk.ourcompany.com/helpdesk/WebObjects/Helpdesk.woa/ra/Tickets/48672?apiKey=1234567890blahblahewrevegert,
      type: 'PUT',
      dataType: 'jsonp',
      data:{
      "subject":"new"
      },
      success: function (data) {
      alert('success');
      },
      error: function (xhr, ajaxOptions, thrownError) {
      alert(JSON.stringify(xhr));
      alert(JSON.stringify(thrownError));
      }
      });

      I can run GET commands just fine which allows me to retrieve data, but I can't update any tickets using the PUT command.

       

        • Re: Updating tickets in WHD using JavaScript
          matt_in_slo

          I wish I had an answer for you, but unfortunately I'm just trying to figure out how to interact with the SW API using JavaScript myself. 

           

          Quick question, maybe you know the answer:  If I have to include username and password info in my ajax request, would I put it in the data field?

           

          data{

          "username":"Bob",

          "password":"mypassword"

          },

           

          Like that?