Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Kengwhye
Contributor
Contributor

Connecting to Qlik SaaS API via Python

Hi All,

I was just wondering if anyone has a template code in Python to connect to Qlik SaaS's API. I'm a tenant admin for my organization and was hoping to explore usage of the API to automate some of the Admin workflows in Python. 

 

I've searched for some boilerplates online using the requests library in Python but was unable to make the connection. The error that was shown is as follows:

SSLError: HTTPSConnectionPool(host='organization.sg.qlikcloud.com', port=443): Max retries exceeded with url: /api/v1/users/me (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)')))

Seems to me that there is a need for an additional certificate for authentication.

 

I've gone through the admin panel to create a personal API key and that was the API key that I've used to authenticate.

 

Below is the code that I've used to test the connection:

 

 

import requests
import json

apiurl ="https://organization.sg.qlikcloud.com/api/v1/users/me"
headers = {"Token": "api token here"}

result = requests.get(apiurl, headers=headers).json()
print(json.dumps(result, indent=4, separators=(". ", " = ")))

 

 

import requests
import json

Labels (2)
1 Reply
alex_colombo
Employee
Employee

Hey @Kengwhye please have a look to our Platform SDK for connecting to Qlik SaaS with Python