Hello, I would like to interface the version 1.7.7 of osTicket with a webapp already operated through the use of the API. Unfortunately, the documentation I've found is not exhaustive. without examples. I think the best way for me is to use the APIs provided and XML. I do not understand the use of the KEY and how to pass parameters through XML and Classic ASP. Is there anyone who has managed to do to open a new ticket with the API and Classic ASP?

Sorry I haven't looked at or touched ASP since... well circa 98...

ok, ASP is old but more than enough to carry the majority of applications. send a request in xml should not be impossible, or not?

I was trying to say that I have no idea, because I haven't played with that technology in a really long time. I would think that it should be possible, but I don't have the foggiest idea how to do it.

I'm sorry, there is not the impression I wanted to give, I missed the sense of the phrase. I want to say that since there are APIs osTicket it seems strange that it is not happened to anyone else ASP to interface with osTicket. I do not speak English well .. ;-)

I tried this, but the result is always: Error 500 :-(

a month later

It looks like you're posting the request wrong, it should be the body of the request as shown below.' post the XML to the ticket system....Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")objXMLHTTP.Open "POST", TicketURL, falseobjXMLHTTP.setRequestHeader "X-API-Key", APIKeyobjXMLHTTP.setRequestHeader "Content-Type", "text/xml"objXMLHTTP.Send msgXMLresult=objXMLHTTP.responseTextSet objXMLHTTP = NothingCheers

thanks guys!try tomorrow and I can tell you the results.

6 days later

Hi Peter

You are correct, I was re-writing the code on the fly...

hello guys .... With your script no longer receiving error from the server.The ticket is not yet open. and does not receive the message from the XML result = objXMLHTTP.responseText is null or empty. What should I watch?

Check your api key and IP address, the IP address will most likely be the root IP address of the web server not the IP of your website.

If you go log into osticket admin you should be able to view the logs, which will tell you why it failed.

Unfortunately when I launch the page NewTT.asp with the code written by you not receive any feedback. the API code is correct and the IP address is the public server where the page NewTT.asp runing. NewTT.asp and os Ticket are on two servers with two different IP addresses. LOG is empty it says only: congratulations you have installed osTicket ..

3 months later

Finally works !!Classic ASP & XML Ticket Created !!'DecriptDim TicketURLTicketURL = "http://www.domain.ext/support/api/http.php/tickets.xml" APIKey = "ED58F859E0D90A7815D9DDFC43947C8"'XML dataXML_SendData = ("<?xml version=""1.0"" encoding=""UTF-8""?>")&  vbCrLf XML_SendData = XML_SendData & ("<ticket alert=""true"" autorespond=""true"" source=""API"">")&  vbCrLf XML_SendData = XML_SendData & (" <name>Nome cognome(API)</name>")&  vbCrLf XML_SendData = XML_SendData & (" <email>nomecognome@domain.com</email>")&  vbCrLf XML_SendData = XML_SendData & (" <subject>Testing API</subject>")&  vbCrLf XML_SendData = XML_SendData & (" <phone ext=""123"">318-555-8634</phone>")&  vbCrLf XML_SendData = XML_SendData & (" <message>Message content here</message>")&  vbCrLf XML_SendData = XML_SendData & (" <ip>000.000.000.000</ip>")&  vbCrLf XML_SendData = XML_SendData & ("</ticket>")&  vbCrLf Set XMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")xmlHTTP.open "POST", TicketURL, falsexmlhttp.setRequestHeader "Content-type", "text/HTML; charset=utf-8"xmlHttp.setRequestHeader "X-API-Key", APIKeyxmlHTTP.send XML_SendDatastrStatus = xmlHTTP.StatusstrRetval = xmlHTTP.responseTextresponse.write strStatus&"<br>"response.write strRetval&"<br>"'response.write XML_SendDataSet xmlHTTP = nothingSet xmlDoc = nothing

Write a Reply...