Enabling the API
Hi, I would be grateful if someone can help me with this problem I am having in regards to enabling the KACE API. I have enabled the two API settings which I can find which as enabled the WSAPI and the /ams/shared/api/.
The API I actually want to use is the /api/ to retrieve information about different devices with an example like the following
https://k1000/api/inventory/machines/?shaping=label%20all
The only response I get is "{"error": "API disabled."}"
The most likely solution to this is that I am being oblivious and missing something obvious but if someone could help me out I would love to know what it is so I can start working with the desired API as soon as possible.
I have gone through the settings and enabled the Federation and the Inventory Access API which are the only two I can see, maybe there is a third I am missing?
If you are able to help and have any questions or suggestions please let me know.
I am running version 10.1.99
regards,
EDIT: The solution is that the provided error message is incredibly misleading the API was actually enabled taking attention from the real issue.
Answers (1)
Top Answer
The first step is to login and save the token, when is the “x-dell-csrf-token” returned byLogin.
The token must be included with any other API call.
What programming language are you using to craft your API request or you using Postman to test with?
Login
· Type: POST
· URL: {host}/ams/shared/api/security/login
· Headers:
o Content-Type:application/json
o Accept:application/json
· Body:
o {"userName": "{username}","password": "{password}"}
· Example:
o Type: POST
o URL: k1000/ams/shared/api/security/login
o Headers:
§ Content-Type:application/json
§ Accept:application/json
o Body:
§ {"userName":"admin", "password": "123456"}
Comments:
-
Hi Kevin, thanks for the reply. Anything in regards to "/ams/shared/api" works, it is just the "/api/". From that login request, I keep the relevant headers and cookies.
I am using C# and testing with HttpWebRequest and rest-sharp. - Kristan 3 years ago