title: How do I login/authenticate through API on KACE 1000 System Management Appliance 7.0
body: <p>Here is my python code:</p>
  
  <pre><code>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()
  </code></pre>
  
  <p>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</p>
  
  <blockquote>
    <p>&lt; Response [401] ><br>
    {'errorCode': 29, 'errorDescription': 'Login Failed: Incorrect user name or password.'}</p>
  </blockquote>
  
  <p>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.</p>
  
  <p>Thank you!</p>