Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I’m trying to connect Python to QlikSense in order to perform the same operations as the Qlik engine API explorer, but when I try this code:
import websocket
import ssl
import json
import requests
user_directory = <user_directory>
user_id = <user_id >
header = ['X-Qlik-User: UserDirectory=' + user_directory + '; UserId=' + user_id]
ws = websocket.create_connection("wss://<myserver>/app/", sslopt={"cert_reqs": ssl.CERT_NONE},header=header)
ws.send(json.dumps({
"handle": -1,
"method": "GetDocList",
"params": [],
"outKey": -1,
"id": 1
}))
result = ws.recv()
print(result)
ws.close()
It returns this to me:
{"jsonrpc":"2.0","method":"OnAuthenticationInformation","params":{"loginUri":"https://<myserver>/internal_forms_authentication/?targetId=<ID>","mustAuthenticate":true}}
How can it return the result of my query ?
Thanks !
In the message it returned, the property "mustAuthenticate" is set to "true" indicates that you have not yet been correctly authenticated.