Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Spartan27215
Partner - Creator
Partner - Creator

How to bulk add users when using Azure AD Idp

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?

Labels (2)
20 Replies
NadiaB
Support
Support

Hi @Spartan27215 

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!

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
Spartan27215
Partner - Creator
Partner - Creator
Author

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.

NadiaB
Support
Support

@Spartan27215 

It looks to me that is here 

https://www.nuget.org/packages/QlikSense.NetSDK

Let me confirm with the team. 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
Spartan27215
Partner - Creator
Partner - Creator
Author

Can you also verify that it works with SaaS, and if there are any code examples?

NadiaB
Support
Support

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!

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
Spartan27215
Partner - Creator
Partner - Creator
Author

Any Idea why this is not covered in the Developer Portal?

Spartan27215
Partner - Creator
Partner - Creator
Author

I got it the first time. It does NOT apply to what I am asking.

NadiaB
Support
Support

Hi @Spartan27215 

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!

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
Spartan27215
Partner - Creator
Partner - Creator
Author

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?

NadiaB
Support
Support

Hi @Spartan27215 

The Authentication methods are listed here:

https://qlik.dev/basics/authentication-options

I'm using the last one for this sample.

 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm