Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
arkham
Contributor II
Contributor II

How to access ExportData URL via Qlik Engine API

Hello,

I have the following issue:

I wrote a python script to connect to the Qlik engine API via websocket to gather information about the content of a table and export it. The whole script is working and as a result I receive a qURL that I append to my server URL and get the final URL. After adding this URL into the browser, the browser is downloading the file. So far, so good.

 

Expected Outcome

I would like my script to access this URL and download the CSV file locally. But so far none of my attempts worked. Whenever I tried using the request module, a timeout was presented to me without any file.

Reading in another post, I learned one can't download that file through a websocket. You need to do an HTTP GET to download it. But for the HTTP GET you also need to send the session cookie of the websocket session. 

So how can I catch the cookie from the header response of the websocket session? I checked 

websocket.enableTrace(True) and was able to see the cookie put can't save it to a variable this way.
 
 
And even after getting the cookie, where should I send my GET request to, to access the file from the download? 
 
Does anyone have a solid solution here? I just need the content of the file but I'm out of ideas and found only snippets to various attempts without solving this riddle.

 

Labels (1)
  • API

1 Solution

Accepted Solutions
ajaykakkar93
Specialist III
Specialist III

API is called as QRS API which generates a session ticket for a user.

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

View solution in original post

3 Replies
ajaykakkar93
Specialist III
Specialist III

Hi,

Simply you can generate a ticket via python or bat file using CRUL & get that file downloaded.

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

arkham
Contributor II
Contributor II
Author

Hi,

Thanks for your reply. Which Qlik API do I need to use here? I never worked with tickets in Qlik before

ajaykakkar93
Specialist III
Specialist III

API is called as QRS API which generates a session ticket for a user.

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting