Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
richardpearce60
Contributor II
Contributor II

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 II
Contributor II
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 II
Contributor II
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=(". ", " = ")))