OAuth2 machine credential using Python

from qlik_sdk import Auth, AuthType, Config

# define the OAuth2 client configuration
# host in the format like https://screenshot.us.qlikcloud.com
client = Auth(
    config=Config(
        auth_type=AuthType.OAuth2,
        host='https://<TENANT_HOSTNAME>.<TENANT_REGION>.qlikcloud.com',
        client_id='<CLIENT_ID>',
        client_secret='<CLIENT_SECRET>',
    )
)

# authorize the client configuration with your Qlik Cloud tenant
client.authorize()

# call the /users/me rest endpoint with the client configuration
response = client.rest(path="/users/me")
print(response.json())

Check it out on Replit.

Read the tutorial

ON THIS PAGE

Was this page helpful?