Logging into the Qlik Enterprise Manager console prompts for a username and password. The login is generally in the format of domain_name\username. These credentials can be used for curl to obtain a sessionid to run API commands from curl.
You can authenticate either using domain\username or basic authentication using a base64 encoded string of the username and password.
Username and Password:
- Open a command prompt
- Run the following command, where DOMAIN_NAME\USER is the username you want to authenticate with and <your URL> the hostname.
curl -i -k -u DOMAIN_NAME\USER https://<your URL>/attunityenterprisemanager/api/V1/login
- Enter the password when prompted
- Copy the apisessionid returned
![sessionid returned with CURL.png sessionid returned with CURL.png](https://community.qlik.com/t5/image/serverpage/image-id/125944iE2D70544EE451C27/image-size/large?v=v2&px=999)
Basic Authentication:
- Encode your username and password using a base64 encoder
- Create the following string out of your username and password: USER@YOURDOMAIN:YourPassword
- Use a base64 encoder to encode the string. The result will look something like this: YWRtaW5YWw6UGFzc3dmQxMjMh (not a real result)
- Copy the result
- Open a command prompt
- Run the following command, inserting your encoded credentials and hostname:
curl -i -k --header "Authorization: Basic YWRtaW5YWw6UGFzc3dmQxMjMh" https://<your URL>/attunityenterprisemanager/api/V1/Login
- Copy the apisessionid returned
![sessionid returned with CURL basic authentication.png sessionid returned with CURL basic authentication.png](https://community.qlik.com/t5/image/serverpage/image-id/125948i0C3765B737241886/image-size/large?v=v2&px=999)
You can then use the generated session ID to run other API commands. The session ID is valid for ten minutes before a new one needs to be created.
Example API call to stop a task:
curl -i -k -X POST --header "EnterpriseManager.APISessionID: YdfaW5YWw6UGFzs3dmQxMjMh" --header "Content-Length: 0" https://SERVERNAME/attunityenterprisemanager/api/v1/servers/Replicate/tasks/Test-Task?action=stop
Environment
Qlik Enterprise Manager