How do I login/authenticate through API on KACE 1000 System Management Appliance 7.0
Here is my python code:
# Import script for porting information from the KACE server
import requests
def main():
username = 'test'
password = 'test'
org_name = 'Default'
session = requests.session()
session.params = {'password': password,
'userName': username,
'organizationName': org_name}
session.headers = {'Accept': 'application/json',
'Content-Type': 'application/json',
'x-dell-api-version': '5'}
login_path = 'SERVER/ams/shared/api/security/login'
response = session.post(login_path)
print(response)
print(response.json())
if __name__ == '__main__':
main()
I am able to log in manually through the browser with the account test and password test as an admin. However, when running the above code I get
<Response [401]>
{'errorCode': 29, 'errorDescription': 'Login Failed: Incorrect user name or password.'}
I've been stuck on this for more than an entire day at work. I need to get access to the API in order to run queries with scripts. I called customer support and they . made me wait for 1 hour before telling me no engineers were available. ANY help would be greatly appreciated. I want to be able to get a CSRF token with a status 200 response from the post request.
Thank you!
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
zel123
7 years ago