Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

arulsettu
Honored Contributor 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
erik_wetterberg
Valued Contributor III

Re: Connect to Qlik App

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

Erik Wetterberg
https://extendingqlik.upper88.com/
arulsettu
Honored Contributor III

Re: Connect to Qlik App

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

{

    "method": "OpenDoc",

    "handle": -1,

    "params": [

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

  

    ]

  

}

erik_wetterberg
Valued Contributor III

Re: Connect to Qlik App

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

Erik Wetterberg
https://extendingqlik.upper88.com/
arulsettu
Honored Contributor III

Re: Connect to Qlik App

Erik

Added the lines in json still same error

"jsonrpc": "2.0",

"id": 0,


i believe something else i am missing


Thanks

erik_wetterberg
Valued Contributor III

Re: Connect to Qlik App

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

Erik Wetterberg
https://extendingqlik.upper88.com/
arulsettu
Honored Contributor III

Re: Connect to Qlik App

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"}}

erik_wetterberg
Valued Contributor III

Re: Connect to Qlik App

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

Erik Wetterberg

Erik Wetterberg
https://extendingqlik.upper88.com/
arulsettu
Honored Contributor III

Re: Connect to Qlik App

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

arulsettu
Honored Contributor III

Re: Connect to Qlik App

Hi akl can you help here

Community Browser