Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello guys,
I am trying to upload a Qlik Sense app into the QMC with a python script using the REST API.
I am using the following script:
import requests
I am struggling all the day with this issue I have no idea what I am doing wrong in Python. Has anybody an idea what could be the problem with the script?
BR,
Rumen
https://github.com/clintcarr/qrspy/blob/d6950b4d746cbe99b88edbd830bfb9e923544f2d/qrspy.py#L794
def import_app(self, name, filename):
"""
Imports an application
:param name: Name of application to import
:param filename: Path and file of qvf
:returns: HTTP Status Code
"""
path = 'qrs/app/upload?name={0}'.format(name)
headers["Content-Type"] = "application/vnd.qlik.sense.app"
headers["Connection"] = "Keep-Alive"
with open(filename, 'rb') as app:
return self.post(path, app)
https://github.com/clintcarr/qrspy/blob/d6950b4d746cbe99b88edbd830bfb9e923544f2d/qrspy.py#L794
def import_app(self, name, filename):
"""
Imports an application
:param name: Name of application to import
:param filename: Path and file of qvf
:returns: HTTP Status Code
"""
path = 'qrs/app/upload?name={0}'.format(name)
headers["Content-Type"] = "application/vnd.qlik.sense.app"
headers["Connection"] = "Keep-Alive"
with open(filename, 'rb') as app:
return self.post(path, app)
It works fine! Thank you @Marc
Hi @vasilev ,
what exactly you made changes in your code to get this worked as per Marc reply.
could you please share the code which is working for you using python.
Thanks in advance
BR,
Naresh
Hi @Marc ,
I am struggling to incorporate the above code with python to upload the Qlik Sense application.
could you please help me with working code for this.
Thanks
if you check the link in my original post,
you will see that the ReadMe has instructions on how to connect to your Qlik Sense Server
Instantiate-the-connectqlik-class
Once you have the QRS class you can then use it to Import the apps with the import_app method, (just adapt the for loop for a single qvf rather than for each app in the dir)