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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
dvillar3589
Contributor II
Contributor II

How Can I Allow End Users to Use my REST API calls??

Hello all,

Any help or advice would mean the world!!

I created a Qlik app in Qlik Sense Enterprise and was able to create a REST API POST connection that triggers a Databricks job(the REST connection uses an access token i created from Databricks) to run with dynamic selections made by the user. Databricks performs some transformations on the data with the parameters sent from Qlik and I then utilize an Apache Spark Connector to read the data back into the app. 

Current methodology: I as the developer can open the app that has a default dataset already loaded. I then make some selections in a couple of filters and click a button called "Load Data". This button sets my selections as variables first and then finally, performs a Load Data action that initiates the REST API call (first action in the qlik load editor) to send my inputs to Databricks and then loads the transformed data back with an apache spark connector(which i also have to give users access to).

The Problem: I can obviously do this myself since I have access to Databricks and it is my REST API connection, but I need make sure users(there will be potentially hundreds) that are using this dashboard will have a seamless way of sending their own inputs through the REST API post method. Is there a way I can somehow change my current configuration so any user with access to the dashboard can utilize its connections? Or anything else?

I have attached my current configuration of my REST API Connector for context:

 

API1.pngAPI2.pngAPI3.pngAPI4.pngAPI5.pngAPI6.png

 

5 Replies
Vegar
MVP
MVP

I understand the problem. The issue is that the users can not alter the document variable on a published app . Any changes to a variable is only locally for the users user interface and will not be Forwarded to the reload script when assuming .

One solution is to make the app available for duplication,  meaning that each user can duplicate the app and have it available in their own work stream.

Note that only users with professional license will be able to edit apps or reload tasks. These features are blocked for analyzer users.

Vegar
MVP
MVP

Another possible way to solve this is to look into app on demand generation (ODAG). Where users can trigger a reload of a template app based on selection in a selection app.

I'm unsure if you can forward variable values or not, but you could in many cases be able to do a workaround by adjusting your data model in the selection app to fit your need.

https://help.qlik.com/en-US/sense/November2024/Subsystems/Hub/Content/Sense_Hub/DataSource/Manage-bi...

dvillar3589
Contributor II
Contributor II
Author

See this is still a little confusing to me because I myself am able to make dynamic selections and when I click the button "Load Data", it first sets those selections as variables(which I have additionally already created in the left hand pane of the sheet) and then the final action of the "Load Data" button performs a Reload Data action. And in my Qlik Load editor, the API call is the very FIRST part of the script that I specify so that I can pass the variables through the REST API to be transformed by a databricks notebook and then read back into the app AFTER the REST API code(picture attached). I am able to do this successfully which leads me to believe if an end user has permission to use the rest api, they should be able to perform the same function.

This is the code that works for me and lets me dynamically set variables in my dashboard and then send them through this REST API POST call successfully. I understand the Bearer token might not be the best route if I intend to publish this and ideally allow permission for over a hundred people to use(i do not want the end users to have to generate tokens, ideally i want it to be a very seamless process for them). I have read some literature about certificates, JWT, but have not been able to quite understand what to change in my initial REST Connector configuration above to achieve what I want.

Qlik_api_code.jpg

Vegar
MVP
MVP

The access to change the variable values at in the core of the app differs between you and the users of an published app. Their edits of users will not be registered by the parts who does the reload. If they had a working copy like you then their changes would have been applied in that copy just as they are for you in yours.

mouadtali
Contributor
Contributor

I'm trying to build a similar solution, where I do a selection on Qlik and send parameters to databricks to run some aggregations, and finally have a results table serving the dashboard in Qlik. the Idea is to off-load the heavy computing to Databricks instead of native Qlik.
Given your experience, what's the latency that you've observed while using this method ?