Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
You can use the .NET SDK with SaaS if you have an API key. You use this class to define your connection:
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);
}
And more information regarding API keys can be found here:
You can use the .NET SDK with SaaS if you have an API key. You use this class to define your connection:
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);
}
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?
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/
And more information regarding API keys can be found here:
Are there any examples on how to get started? I am using SaaS and have created an API key.
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.
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:
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
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.