Skip to main content

Internal error during incident update via RestAPI in C#

  • November 2, 2021
  • 1 reply
  • 110 views

Hello, I'm trying to update an incident via RestAPI within my C# application, but i get an error message: {"status":500,"message":"null"} Below you can see what code i use public void saUpdateTicket(string saTicket, string TDTicket) { string someUser = "********"; string someAccount = "*******"; string somePass = "*********"; SysaidUpdate saUpdate = new SysaidUpdate(); saUpdate.id = saTicket; var objLogin = new Login(someUser, someAccount, somePass); var client = new RestClient("https://<SERVER>:8443/api/v1"); var loginRequest = new RestRequest("login", Method.POST); loginRequest.AddJsonBody(objLogin); var responseLogin = client.Execute(loginRequest); client.CookieContainer = new System.Net.CookieContainer(); var authCookie = responseLogin.Cookies.First(a => a.Name == "JSESSIONID"); client.CookieContainer.Add(new System.Net.Cookie(authCookie.Name, authCookie.Value, authCookie.Path, authCookie.Domain)); List<saUpdateInfo> saInfo = new List<saUpdateInfo>(); saInfo.Add(new saUpdateInfo { key = "CustomColumn3sr", value = TDTicket}); saUpdate.info = saInfo; string json = JsonConvert.SerializeObject(saUpdate); StringContent content = new StringContent(json, Encoding.UTF8, "application/json"); string input = @"/" + saTicket; var getUserRequest = new RestRequest($"sr{input}", Method.PUT); getUserRequest.AddJsonBody(content); var result = client.Execute(getUserRequest); string r = result.Content.ToString(); } Any help would be great. Thanks in advance. Edward

1 reply

Maayan Karstaedt
SysAider
Forum|alt.badge.img
Hi Edward, Try also reaching out directly to our Customer Care team to see if they guide you through this by email: support@sysaid.com or open a live chat with our reps >login to helpdesk > click on "chat with us box" Hope you figure this out! Best, Maayan

Want Some cookies?

No, literally. We have some. 😉 By continuing browsing on our site you agree to our cookie policy.

 
Cookie settings