/build/static/layout/Breadcrumb_cap_w.png

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!


2 Comments   [ + ] Show comments
  • Did you ever solve this? The post to api/security/login used to return a x-kace-csrf-token header but mine doesn't anymore. I'm on version 12.1.168. - caitlynmcorey 2 weeks ago
  • Hi Caitlyn, According to KACE support, the API does not return CSRF token anymore for 12 and above. Instead we need to pass the JWT token in through cookies.

    What programming language are you using to do the API calls? - Ramyach 2 weeks ago

Answers (1)

Posted by: KevinG 1 month ago
Red Belt
0

Remove the call to

request.Headers.Add("x-kace-auth-jwt")
Are using a cookiejar?

Comments:

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ