Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
arulsettu
Master III
Master III

Connect to Qlik App

Hi i was trying to connect qlik engine API using python

How to connect python to Qlik sense server with certificates authentication?

I can connect to qlik successfully. and i tired to get  the list of apps available in qlik server

{'params': [], 'handle': -1, 'name': 'GETAPPLIST', 'method': 'GetDocList'}

it gives the list of apps. after that i was trying to open or connect to the app using below json

{

    "method": "OpenDoc",

    "handle": -1,

    "params": [

        "714aad39-e1a2-485b-82c2-6150c681ef4e"

   

    ]

   

}

it throws error like

{"jsonrpc":"2.0","id":0,"error":{"code":1003,"parameter":"Could not find app","message":"App not found"}}

when i doing same in Engine Explorer it was opening the app. but through above code its not working

Can some one help here to solve the issue

Thanks

9 Replies
ErikWetterberg

Hi,

I don't really know much about Python, but generally you should open a new socket when you open an app, so not try to call OpenDoc on an already existing socket. Not sure that is the problem in your case, though.

Erik Wetterberg

arulsettu
Master III
Master III
Author

in that case i tried open this in new socket but same error

{

    "method": "OpenDoc",

    "handle": -1,

    "params": [

        "714aad39-e1a2-485b-82c2-6150c681ef4e"

  

    ]

  

}

ErikWetterberg

HI,

You are supposed to include an id and the jsonrpc version too, but if that's the problem it's a very strange error message.

Erik Wetterberg

arulsettu
Master III
Master III
Author

Erik

Added the lines in json still same error

"jsonrpc": "2.0",

"id": 0,


i believe something else i am missing


Thanks

ErikWetterberg

The id should be a unique identifier for each message, so 1,2,3 etc.. It's what you use to tell which reply belongs to which request.

Erik Wetterberg

arulsettu
Master III
Master III
Author

Changed the ID also

<websocket._core.WebSocket object at 0x00000000036937F0>

{"jsonrpc":"2.0","method":"OnConnected","params":{"qSessionState":"SESSION_ATTACHED"}}

{"jsonrpc":"2.0","id":1,"error":{"code":1003,"parameter":"Could not find app","message":"App not found"}}

ErikWetterberg

SESSION_ATTACHED seems strange, means it's attaching to an already existing session, is that what you expected??

Erik Wetterberg

arulsettu
Master III
Master III
Author

it is websocket session. i just printed to confirm the connection

arulsettu
Master III
Master III
Author

Hi akl can you help here