Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Gnaneshwari_Venkatesan
Contributor II
Contributor II

Is it possible to create table with one dimension and one measure using Rest API in Qlik sense?

Hi Everyone,

I want to create a simple table with one measure and one dimension using Rest API. I have already created an app using the URL https://your-tenant.us.qlikcloud.com/api/v1/apps. Created a connection with MYSQL Database also using Rest API.

Now please anyone tell me is it possible to create visualizations using the metadata in Qlik sense Rest API.

Thank You,

Gnaneshwari V

Labels (2)
7 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Gnaneshwari_Venkatesan 

I think the answer is yes, but I'm not sure I quite follow the question. Which API is it that you wish to load from?

You may want to take a look at the scripts that ship (for free) with my Instant Sense Application:
https://www.quickintelligence.co.uk/instant-qlik-sense-app/

There are example scripts that connect to the Sense SaaS Session API, RSS Feeds (using REST), GitHub and Twitter.

This blog post on reading the Sense SaaS licence API may also be useful:
https://www.quickintelligence.co.uk/sense-capacity-licence-notify/

I hope that this is of some help.

Steve

Gnaneshwari_Venkatesan
Contributor II
Contributor II
Author

Hi @stevedark ,

Thank you for your reply. I am trying to create a visualization through Rest API (https://qlik.dev/apis/#rest).

Through Postman, I am connecting with Qlik sense using API Key (https://qlik.dev/apis/rest/apps). After creating the app using Rest API, I want load the data into the app(I have created a MYSQL connection from Postman using Rest API and I want to connect that MySQL connection to the app) and using the data I want to create a simple table in the app using same Rest API from Postman.

Thank you,

Gnaneshwari V

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Gnaneshwari_Venkatesan 

In that case, looking at the links I posted above would be a good thing.

To pull the main points from the second link, which will get you capacity usage from Sense SaaS:

Create a new REST connection, give it the URL https://jsonplaceholder.typicode.com/posts set the type to GET and leave everything else as defaults. Give this connection the name GenericGET.

Set variables for your environment:
let vInstance = 'instance.region.qlikcloud.com';
let vAPIKey = '... your API key in here ...';


Connect to the connection you created:
LIB CONNECT TO 'GenericGET';

You can then select, injecting your Cloud URL and API key into the code:
SQL SELECT
(SELECT "name",
"usageClass",
"units",
"unitsUsed",
"overage"
FROM "allotments" FK "__FK_allotments")
FROM JSON (wrap on) "root" PK "__KEY_root"
WITH CONNECTION

(URL "https://$(vInstance)/api/v1/licenses/overview",
HTTPHEADER "Authorization" "Bearer $(vAPIKey)" ) ;

You can get the details for the API call from Postman, or you can use Select Data in Sense and it can generate the code for you. You will need to plumb the API key into the connection dialog if you are doing this.

I'm not sure why you would need to go via MySQL.

Hope that helps.

Steve

Gnaneshwari_Venkatesan
Contributor II
Contributor II
Author

Hi @stevedark ,

In MySQL, I have a schema with four tables. I want to create a visualization(table view) using the data from the MYSQL schema using Rest API. So I created a connection using Rest API(https://your-tenant.us.qlikcloud.com/api/v1/data-connections) to the MYSQL schema. Now how to create a sheet with the connected data inside the app using Rest API from postman not directly from Qlik sense.

Thank You,

Gnaneshwari V

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm sorry, I'm not following what you are doing here.

Why are you creating a REST connection to MySQL, when you could be creating a MySQL connection to MySQL?

If you can show what you are doing so far using screenshots (with sensitive data redacted) and explain what it is that you can not do I may be able to assist further.

Steve

Gnaneshwari_Venkatesan
Contributor II
Contributor II
Author

Hi @stevedark ,

My requirement is to do all the things via Rest API like creating an app, connect with data, load the data to the app and create sheet with one dimension and one measure(table view). Everything should be done from Postman using Rest API.

Hope you understands my requirement.

 The below screenshot is creating app from Postman(https://qlik.dev/apis/rest/apps)

AppCreation.png

After creating the app, the screenshot of app which is created from postman in Qlik sense cloud is below,

Gnaneshwari_Venkatesan_1-1655114375217.png

 

Similarly I want to perform other operations like load the data to this app and create sheet with one dimension and one measure(table view) from Postman using Rest API.

Thank you,

Gnaneshwari V

 

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Gnaneshwari_Venkatesan 

Okay, I now understand what you are wanting to do! Is PostMan just proving the solution prior to building something else to call this in future?

It is possible, I believe, to do just about everything through the APIs, and there are solutions out there which check things in and out of GitHub, for example, which use the APIs. It is non trivial though, and you will need to be taking the results of one call to then pass into the next one.

You might want to try posting into one of the more API specific boards on the Community to see if you can get some assistance there.

I can see you are already looking at https://qlik.dev/ for documentation, this is definitely the best first port of call.

I would also recommend looking around what Qlik App Automation can do for you, specifically the Qlik Cloud Services entries - as you may be able to build a wrapper around things which will really assist you.

Good luck!

Steve