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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
richardpearce60
Contributor III
Contributor III

Qlik SDK post param passing

Hi, I'm working with Qlik Sense SaaS using an OAuth2 connection to one of my tenants with Python3 in Ubuntu.

 

The handshake works fine and I'm able to hit the rest connector and get information about my managed spaces.

 

#Sending params to the API request
payload={'type':'managed'}
response = client.rest(path="/spaces", method="get",params=payload).json()
print(json.dumps(response, indent=4, separators=(". ", " = ")))

 

 

I've now tried creating a space. My code is as follows and fails with a bad request error:

 

payload={"name":"string","type":"shared","description":"string"}
response = client.rest(path="/spaces", method="post", params=payload)
print(response)

 

 

I'm hopeful it's a simple fix. The scope I'm using is admin_classic 

Any help would be appreciated!

 

 

Labels (2)
1 Solution

Accepted Solutions
richardpearce60
Contributor III
Contributor III
Author

Managed to resolve this and it was frustrating simple. Had to use data rather than params:

payload={'name':'The API Made this 2','type':'shared','description':'Long Description here'}
response = client.rest(path="/spaces", method="post", data=payload).json()
print(json.dumps(response, indent=4, separators=(". ", " = ")))

View solution in original post

1 Reply
richardpearce60
Contributor III
Contributor III
Author

Managed to resolve this and it was frustrating simple. Had to use data rather than params:

payload={'name':'The API Made this 2','type':'shared','description':'Long Description here'}
response = client.rest(path="/spaces", method="post", data=payload).json()
print(json.dumps(response, indent=4, separators=(". ", " = ")))