The following steps allow you to query the QPS API from Qlik Sense Script:
Make sure you have access to the Windows machine of the QS node
1. Go to your QMC, /qmc/certificates and click "Export Certificates"
2. check the folloing settings, the "machine name" can be freely chosen, no matter what you put there. You MUST set a password
![ChristofSchwarz_0-1614362132003.png ChristofSchwarz_0-1614362132003.png](https://community.qlik.com/t5/image/serverpage/image-id/49971iCA4AF5817185F5F0/image-size/medium?v=v2&px=400)
3. connect the the Windows and go to folder C:\ProgramData\Qlik\Sense\Repository\Exported Certificates\restconnector (where the last subfolder, "restconnector", is the "machine name" you entered in the QMC before)
4. copy the client.pfx file from this folder to this "C:\ProgramData\Qlik\Sense\Engine\Certificates" (after that you can delete the entire subfolder "restconnector" at
5. go to any app in "my work" on the hub or create a new app, go to the "Load script editor" and create a new data connection with the following settings:
![ChristofSchwarz_2-1614362693870.png ChristofSchwarz_2-1614362693870.png](https://community.qlik.com/t5/image/serverpage/image-id/49973i400C329F8FFE33A7/image-size/large?v=v2&px=999)
The password, of course, has to match the password you set when you exported the certs from the QMC. The client.pfx file will be picked up from the folder where you copied it. After that, you can use the connection in the script to query user sessions, or, if you used the "with connection" parameter of the LOAD command, to other GET-endpoints of QPS. See https://help.qlik.com/en-US/sense-developer/February2021/apis/ProxyAPI/OpenAPI_Main.generated.html#M... for more.
Enjoy