Notification

Icon
Error

Example Use of the GetTicket API call - I am using VB.NET Code block below. I keep getting 500 Internal Server Error

Posted: Monday, January 20, 2020 6:37:40 PM(UTC)
RobWaibelJr

RobWaibelJr

Member Original PosterPosts: 1
0
Like
Quote:

Const WebURL = "http://10.1.1.68:81/api.aspx"
Const URL2 = "http://shastawsus.corporate.local:81/api.aspx"

Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim webREQ As WebRequest, webRES As HttpWebResponse
Dim key As String = HttpUtility.UrlEncode("810f482c-a6d2-44c0-8f65-cc513ab7a0d9")
Dim sWebURL As String = ("?Action=GetTicket&Key=" & key & "&TicketID=22315")
Dim compURL As String = URL2 & sWebURL

webREQ = WebRequest.Create(compURL)
'webREQ.Headers.Add("Accept", "application/json")
webREQ.Credentials = New NetworkCredential("waibelr", "LetM3In!")
Try
webRES = webREQ.GetResponse
Catch wEX As WebException
TextBox2.Text = wEX.Message
Exit Sub
Catch ex As Exception
TextBox2.Text = ex.Message
Exit Sub
End Try

TextBox1.Text = webRES.StatusCode
TextBox2.Text = webRES.StatusDescription
End Sub
Erik.T
#1Erik.T Member Administration Posts: 40  
posted: 1/27/2020 3:01:57 PM(UTC)
Hi RobWaibelJr,

Try querying a ticket with a direct API call like

http://YourServerName:81/api.aspx?Action=GetTicket&Key=123456789&TicketID=1

If the same 500 error is occurring and assuming you've added an API key in the Configuration\Ticket API tab, the issue could be related to your web server setup.

It would be best to send a screenshot of the error message when making a direct call to support@lansweeper.com

Active Discussions

Action PowerShell - Top 10 Memory Hogs
by  iamBaphomet   Go to last post Go to first unread
Last post: Today at 3:00:53 PM(UTC)
Lansweeper Launch TeamViewer from inside LanSweeper
by  CyberCitizen  
Go to last post Go to first unread
Last post: 2/19/2020 12:16:12 AM(UTC)
Action Email user
by  morpios   Go to last post Go to first unread
Last post: 1/26/2020 10:55:44 AM(UTC)
Action Psexec service delete
by  steveb  
Go to last post Go to first unread
Last post: 1/25/2020 12:15:01 AM(UTC)
Lansweeper Uninstall Software - Mozilla Firefox
by  Carl_Allen   Go to last post Go to first unread
Last post: 1/22/2020 10:44:36 AM(UTC)
Lansweeper Installation Parameters
by  PeterG  
Go to last post Go to first unread
Last post: 1/8/2020 10:11:51 PM(UTC)
Lansweeper embedded questions
by  mkergan   Go to last post Go to first unread
Last post: 12/20/2019 5:19:46 PM(UTC)
Lansweeper Result: Deployment ended: The environment is incorrect.
by  mkergan  
Go to last post Go to first unread
Last post: 12/19/2019 6:31:44 PM(UTC)