Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
master_t
Partner - Creator II
Partner - Creator II

.NET SDK on Qlik Sense SaaS?

Hello everybody

I have an application that interacts with Qlik Sense Enterprise/Desktop and makes extensive use of the .NET SDK.

My question is: can che .NET SDK be used to connect to a Qlik Sense SaaS installation? 

If so, how would I do that? And if not, are there plans to support it in the future? Or is there a valid alternative??

Thanks!

Labels (3)
2 Solutions

Accepted Solutions
Øystein_Kolsrud
Employee
Employee

You can use the .NET SDK with SaaS if you have an API key. You use this class to define your connection:

https://help.qlik.com/en-US/sense-developer/August2021/Subsystems/NetSDKAPIref/Content/Qlik.Sense.Js...

A connection could look like this:

 

var location = QcsLocation.FromUri(uri);
location.AsApiKey(apiKey);
using (var app = location.App(appId))
{
    Console.WriteLine(app.GetAppProperties().Title);
}

 

 

View solution in original post

11 Replies
Øystein_Kolsrud
Employee
Employee

You can use the .NET SDK with SaaS if you have an API key. You use this class to define your connection:

https://help.qlik.com/en-US/sense-developer/August2021/Subsystems/NetSDKAPIref/Content/Qlik.Sense.Js...

A connection could look like this:

 

var location = QcsLocation.FromUri(uri);
location.AsApiKey(apiKey);
using (var app = location.App(appId))
{
    Console.WriteLine(app.GetAppProperties().Title);
}

 

 

master_t
Partner - Creator II
Partner - Creator II
Author

Thank you, I will try it out!

Since we are on the topic, is there an equivalent of the Repository Service API? I'm assuming we can't use the QRS API directly, since there is no QMC... or can we?

Øystein_Kolsrud
Employee
Employee

Yes you are right, the QRS is completely gone in SaaS. It's replaced by a set of REST APIs that each have a particular focus. You can read all about them here: https://qlik.dev/

Øystein_Kolsrud
Employee
Employee

Spartan27215
Partner - Creator
Partner - Creator

Are there any examples on how to get started? I am using SaaS and have created an API key.

Spartan27215
Partner - Creator
Partner - Creator

var location = QcsLocation.FromUri(uri);
location.AsApiKey(apiKey);
using (var app = location.App(appId))
{
    Console.WriteLine(app.GetAppProperties().Title);
}

FromUri only returns an IQcsLocation Object which does not contain an App method, in fact, it has very few methods cannot for the life of me figure how this is helpful.

Assuming the URI would be https://myTennant.us.QlikCloud.com (or some similar)?

If I wanted to List my users, how would I do that,

How would I query the users for a space(not knowing the actual spaceId)

Add Users to a space(not knowing the actual spaceId....

Use any of the API's etc.

 

Øystein_Kolsrud
Employee
Employee

Perhaps you imported the generic QcsLocation base class from Qlik.Sense.JsonRpc instead of the engine interface version from Qlik.Engine? That would explain why there is no "App" method available to you.

There are a couple of examples of how to connect and get started here:

https://github.com/AptkQlik/PublicExamples

And an example that focuses on hypercubes and data access can be found here:

https://github.com/kolsrud/qlik-dot-net-sdk-hypercube-usage

Øystein_Kolsrud
Employee
Employee

But the .NET SDK only focuses on the engine API. The information you are looking for (user and space information) is not part of the engine domain. You probably want to utilize the REST APIs of QCS. The endpoints in question (for users and spaces) are these:

https://qlik.dev/apis/rest/users
https://qlik.dev/apis/rest/spaces

The following library can be used to call REST endpoints from .NET with authentication flow very similar to what you would use for the .NET SDK:

https://www.nuget.org/packages/QlikSenseRestClient/

Some examples to get started with that library can be found here:

https://github.com/kolsrud/qlik_rest_sdk/tree/master/Qlik.Sense.RestClient/Examples

Spartan27215
Partner - Creator
Partner - Creator

One thing that is not clear is what URL do I connect to. All the samples just use a mystery variable  representing the URL. No information on how the URL should be formed.

One example uses a pem certificate during connection, where would that come from? I am only aware of an API key.

The examples are not very helpful they seem geared to local install not SaaS.