This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Updating tickets in WHD using JavaScript

FormerMember
FormerMember

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.

 

  • FormerMember
    0 FormerMember

    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?