READ and Create tickets using API for KACE SME 12.1 in asp.net Core
Hi,
I am trying to read and create tickets in KACE SME using API call. I am using asp.net MVC to make the calls.
I am able to login using API and get JWT authorization token. But when I try to use the token to make sub sequent API calls I am getting 401 "Unauthorized" error.
I contacted KACE support and they mentioned version 12 and later need to JWT token instead of CSRF token.
Here is below code that I am using to make my API call.
HttpClient client = new HttpClient();
string Endpoint='"https://K1000/api/service_desk/tickets";
var request = new HttpRequestMessage(HttpMethod.Get, Endpoint);
request.Headers.Add("x-kace-api-version", "9");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Add("x-kace-auth-jwt", KACEAuthentificationResponse);
var response = await client.SendAsync(request);
Not sure what I should be sending in the Header to make a successful API Call.
The version of KACE sme :12.1.168
Thanks in Advance!
What programming language are you using to do the API calls? - Ramyach 2 years ago