Forum Discussion
- Mike SudingActive ContributorHere's an example PHP page that you can download and use on your website (internet or intranet) to submit an incident. It uses a few features of API.
Click to see this Example page
INSTRUCTIONS:
- If you haven't already, get your free API key for your account by requesting it via support@GoToAssist.com
- Host this webpage on a web server that has PHP running on it.
- Make the easy changes to specify your API key and service_id.
You can find your service_ID (18 digits) with this other webpage
( link )
I hope this helps.
If you prefer to have this in ASP.NET instead of PHP, reply to let us know and we will try to create one.
DOWNLOAD:
Download PHP page
note: A good tool to test the API is "curl" command line http://curl.haxx.se/download.html or "PostMan" browser plugin. - Stewart11New MemberHi Mike,
Is it possible to post a vb.net / asp.net code as well. I have tried but am having issues being able to connect... I can connect with curl via command line so it is coming down to my code :(
Cheers - Mike SudingActive ContributorWe don't have the equivalent code in ASP. My thought was that since PHP can run on Windows or Linux this is a good choice. Will that work for you? If not, please explain why. If we get several requests, I can get a ASP version created.
- Stewart11New MemberHi Mike,
Thanks for that. As it stands, I'm now able to connect via vb.net / asp.net. We are a .Net shop and no-one understand PHP at all at work.
I do have a question thou, is there any more documentation on the API??? I following www.beetil.com/api for most of it but found out that I could do incidents.json?report_id=#reportno# which is a big win for me which isn't in documentation...
Cheers - Mike SudingActive ContributorNo more documentation yet. It is being migrated to a Citrix location soon.
- Miles MaddoxNew MemberI had been looking for the API docs for some time as well. Not sure how long it's been posted, but there's a PDF from Citrix here:
https://support.citrixonline.com/en_US/GoToAssistServiceDesk/downloaddocument/G2ASDD00003
edit: updating link to current doc - Hitesh VardeNew MemberHello,
I am looking for integrating GoToAssist API using ASP.NET, does anyone have any idea that can help me for doing it?
Any code or samples ??
Your early response would be highly appreciated.
Thanks,
Hitesh - Stewart11New MemberHi Hitesh,
I was playing around with the ASP.NET for a while but found it very clunky and slow but that might have been the way I was using it...
What I was trying to do was create a report (in GTA) which had the required details in it and then show it up in a dashboard on our service desk wall with other dashboards (reports)...
I created a "function" to count the number of open tickets within a department.
Public Shared Function GetCountFromReport(ByVal reportnumber As String) As String
' Build URL with report number at the end
Dim wURL = "https://deskapi.gotoassist.com/v1/inc...=" & reportnumber
Dim mRequest As HttpWebRequest = WebRequest.Create(wURL)
mRequest.ContentType = "application/json"
'API code. The "x:" must before the API code.
Dim usernamePassword As String = "x:APICODE"
Dim enc As New UTF8Encoding()
mRequest.Headers.Add("Authorization", Convert.ToBase64String(enc.GetBytes(usernamePassword)))
Dim wResponse As HttpWebResponse
Try
wResponse = mRequest.GetResponse()
Dim sResponse As String = ""
Using srRead As New StreamReader(wResponse.GetResponseStream())
sResponse = srRead.ReadToEnd()
End Using
Dim x() As String = Split(sResponse, ",")
Dim y() As String = Split(x(2), ":")
Return y(2)
Catch ex As Exception
Return ex.Message.ToString
End Try
End Function
Where it shows APICODE, replace with your API as found in the GTA.
I would call that function via:
Dim AugTC As Integer = Convert.ToInt32(clReport.GetCountFromReport(REPORTNUMBER))
Replace REPORTNUMBER with the report number of GTA.
The biggest problem for me was getting the connection to GTA working. Once I had that sorted then the API's as listed in Beetil started to make sense. www.beetil.com/api but it looks like the site is shutdown.
It is written in VB.net but should be easy to translate to C#.
Hope that helps...
Stewy - Mike SudingActive ContributorThe API docs are here:
http://support.citrixonline.com/en_US... - Hitesh VardeNew MemberHi Stewart,
Thanks for your prompt reply. Very much helpful !
I tried your code and got success with connecting the GTA.
Have you ever tried posting anything using this API?
My requirement is to create / update "company" using GTA API.
Thanks,
Hitesh