Does anyone have a real world example of using the API?
I am trying to learn how to use the KACE API, but the given documentation is scanty, at best. Has anyone used the API successfully? I am trying to use Postman to test the API. Any help would be most appreciated.
What version of the SMA?
What programming language are you familiar with and plan to use to make the API calls?
There are examples available in previous posts, you may want to search to see if a previous post contains an example in the programming language you plan to use.
What do you want to accomplish with the API?
Not sure what programming language I will end up using. Right now I am more concerned about successfully executing a call to the API. To do this I am using the Postman application.
Hardware Model: Virtual (VMware/Hyper-V/Nutanix)
In the end I hope to create a parent ticket and then various child tickets.
Postman can be used to test the API on 12.1.
The API has been available since at least SMA version 9.0 and has been successfully used by customers.
You start with the login API call in postman. Make sure to have enabled API for the SMA and the user on the SMA.
Once you have successfully logged in, you may make other API calls.
POST <Your SMA IP or hostname>/ams/shared/api/security/login
// Add headers in postman
// Body content in postman using your credentials
This worked from the standpoint that I actually got a response, but that response was "Invalid user or password", so I've got a little ways to go. Do you need to be an administrator to use the API? - chrisamaru 2 months ago
You do not need to be an admin. However, you will need to set the values for the userName and password to valid credentials on the SMA. - KevinG 2 months ago
I did set those values to the credentials I use when I login to work on tickets. It said they were invalid. - chrisamaru 2 months ago
I guess you have to be very exact. You can't use "username", you have to use "userName". Once I got that right, I was logged in. Just have to figure out how to use the API to open a ticket. - chrisamaru 2 months ago
I'm not sure what I'm doing wrong, but when I try to do a call to the API that is supposed to create a ticket, I get an Unauthorized response. My call to the login API is successful and I get the bearer token. I add that as a x-kace-csrf-token header in the create ticket API. Does anybody have any insight into what might be going wrong? - chrisamaru 2 months ago