Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Out SaaS tenant uses Azure AD integration, when we 1st got started and to get the model and application(s) built we only needed a few users so we we through the typical, login routine to make the user known to Qlik and then went in and assigned the user resources and permissions. However now that we are wanting to open this up to MANY users I need some other way (like a way to import) to bring add these users in bulk and be able to assign them to their respected managed space(s) with the appropriate permissions.
Has something like this been developed?
By any chance have you seen this already ?
https://community.qlik.com/t5/Integration-Extension-APIs/NET-SDK-on-Qlik-Sense-SaaS/td-p/1831415
Hope it helps!
Where do I find this .NET SDK? When I visit the developer portal there is no reference to one (Overview | Qlik Developer Portal). If you are referring to the Platform SDK (Introduction | Qlik Developer Portal) it says it is only available in 2 languages Typescript and Python, neither of which is a .NET language and neither of which I am willing to learn just to do this.
It looks to me that is here
https://www.nuget.org/packages/QlikSense.NetSDK
Let me confirm with the team.
Can you also verify that it works with SaaS, and if there are any code examples?
I would reach out @Øystein_Kolsrud , he posted the comment in the provided link:
https://community.qlik.com/t5/Integration-Extension-APIs/NET-SDK-on-Qlik-Sense-SaaS/td-p/1831415
He is more familiar with what would work for SAAS and what things might not be SAAS ready, the post includes some limitations I'm not sure if we have documentation around that.
Hope it helps!
Any Idea why this is not covered in the Developer Portal?
I got it the first time. It does NOT apply to what I am asking.
You can call the endpoints with .net it just won't be with the SDK, that applies for Engine only as confirmed with our team.
The endpoints are found here:
https://qlik.dev/apis/rest/users#%23%2Fentries%2Fusers-post
The API Key can be obtained as documented here:
Generating an API key from the hub
It's being a while since I developed something in .net so I'm placing a very basic sample, it seems that there is a popular library for Rest API's implementation called RestSharp, I did a quick test and it worked for me you probably can start from there and make a more scalable solution or at least have a reference of what parameters need to be provided:
using RestSharp;
var resource = "api/v1/users";
var barearkey = "Bearer <yourAPIKEY>";
var tenant = "https://<yourtenant>.us.qlikcloud.com/";
var body = @"{""name"":""John Smith 4"",""email"":""john.smith4@corp.example"",""status"":""invited"",""picture"":""https://corp.example/docs/jsmith.png"",""subject"":""1234asdasa6786"",""tenantId"":""<your tenant ID>""}";
var client = new RestClient(tenant);
var request = new RestRequest(resource, Method.Post);
request.AddHeader("Authorization", barearkey);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", body, ParameterType.RequestBody);
RestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
You can add more attributes for the user, I just did a quick test but you can also add roles if needed.
Hope it helps!
I was under the impression that you had to do an authentication using the API key to get a bearer token to use in the remaining calls. Looks like the way you are doing it there is no authentication, instead you are using the APIkey as the baerer token. Can you confim?
The Authentication methods are listed here:
https://qlik.dev/basics/authentication-options
I'm using the last one for this sample.