Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
I am trying to use the qlik app in my website and when I tried to get the list of sheets of app I am not able to get it.
I have used the python for the implementation
Library: https://pypi.org/project/qlik-sdk/
I am referring to the below documentation: https://qlik.dev/apis/rest/apps
Please let me know how I can get the list of sheets of app in python.
Hello @hsharma-lsquared
Getting the list of sheets inside an app is performed through the Qlik Engine API. (what is referred as the rpc_client inside the Qlik Python SDK)
So you cannot use the REST APIs to get that information.
The rough flow would be:
1. Open the app
2. Fetch the SheetList object
3. Get the layout of the SheetList object (which contains the list of sheets and all their information such as ID, name and thumbnail information, etc)
Here is a rough example using the Qlik Python SDK:
from qlik_sdk import Auth, AuthType, Config
api_key = "eyJhbGciOiJFUzM4NCIsImtp...1kSVLwxfrru_pJaNMrqW3UsRfdxUA6"
base_url = "https://xxx.ap.qlikcloud.com"
auth = Auth(config=Config(host=base_url, auth_type=AuthType.APIKey, api_key=api_key))
app_id ="1f488c45-18b3-4037-84f8-b0700b892063"
rpc_session = auth.rpc(app_id=app_id)
with rpc_session.open() as rpc_client:
app = rpc_client.send("OpenDoc", -1, app_id)
handle = app["qReturn"]["qHandle"]
slist_object = rpc_client.send("GetObject", handle,"SheetList")
slist_handle = slist_object["qReturn"]["qHandle"]
slist_layout = rpc_client.send("GetLayout", slist_handle)
print(slist_layout["qLayout"])
Hope this helps.