Hi and welcome to Qlik Fix! This video will demonstrate how to install and configure Qlik-CLI for SaaS editions of Qlik Sense. Qlik-CLI gives you access to Qlik Sense public APIs via CLI, which is useful when writing automation scripts and performing repetitive tasks. It can be downloaded directly from github and is available for Mac, Linux, or Windows. When downloading for Windows, copy the executable to a local directory, and it just needs to be added to the Path System variable as shown here. Now we can re-open PowerShell, and it is ready for further configuration. You can use the following command to confirm its location path. Another option for installing Qlik-CLI on Windows is to use Chocolatey, which is a package management tool that allows for installing and upgrading qlik-cli via command line. Chocolatey can be installed by following the PowerShell steps under its installation web page. Keep in mind that if you use NodeJS, it is possible that it has already been installed as it can be included as a needed tool in the nodejs. To install qlik-cli using Chocolatey, run this command that points to the NuGet web source location shown. Remember to specify the latest package version in the command. Here we see the command succeeds, but if there are any issues finding package in the specified source, it can be downloaded directly from NuGet.org under this location. Then add the local file location as source in the install command as shown here. After the installation, it is useful to enable the Completion feature. This allows for the user to use the TAB key and have commands, flags, and resources suggested or auto-completed. To enable this in Powershell, first create a profile if no profile exists yet. The following command can be run in order to check for an existing profile and to create a blank one if no profile exists. Then open the profile file with this command using notepad, and add the following to the profile file, and restart PowerShell. Note that this will enable completion only to Windows PowerShell via the current logged on user profile. Also, if completion is needed with PowerShell ISE, perform the same steps using PowerShell ISE which creates a separate profile. For enabling completion in Bash or zsh, follow the instructions under the qlik-cli Installation page. Now we can create the qlik-cli context for the connection with the Qlik Sense tenant typing the command "qlik context init" Here we type Qlik Sense tenant URL, and now we need to obtain an API Key in order to create the API connection trust. The key is created via Cloud Hub so we have logged on with the user account that will be used to authenticate the API connection. If the API Key section is not seen under Settings and Management, under the tenant's Management Console and under Settings, make sure that "Enable API keys" is set. Also, the user creating the API Key must be given the Developer Role permissions, and must have a Professional License assigned Next, go back to Cloud Hub, and under Settings and Management create a new API Key for authenticating the qlik-cli API connections. This API Key is essentially a JWT token and its header and payload metadata can be visualized in jwt.io Notice here the sub attribute indicates the user ID in SaaS used for the authentication. Now, we can paste the key back in the PowerShell to create the new context for the connection to the SaaS tenant. We can check on which contexts are available and the one being used with the "qlik context ls" command. If needed, the context can be changed with the "context use" command. Now we can test the connection with any API call, such as with the following command to list existing App names. (qlik item ls --resourceType app | select-string 'name":') Then search for an App's and meta data information by App name with the following command. (qlik item ls --resourceType app --name "app name") For more information on a particular command, use --help after each command parameter. For example, when selecting parameters using completion, then typing --help will list the available commands and flags for the current command context. Here's another example. If you’d like more information, Take advantage of the expertise of peers, product experts, and technical support engineers by asking a question in a Qlik Product Forum on Qlik Community. Or search for answers using the new SearchUnify tool. It searches across our Knowledge Base, Qlik Help, Qlik Community, Qlik YouTube channels and more, all from one place. Also check out the Support Programs space. Here you can learn directly from Qlik experts via a Support webinar, like Techspert Thursdays. And don’t forget to subscribe to the Support Updates Blog. Thanks for watching. Nailed it!
Attached is a downloadable .mp4 video file for those who cannot view YouTube videos.