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?
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!
Here is what I got to work not using anything other than the C#.NET built-in HTTP Client and Response objects. Note I fashoned the response uing a Json to C# converter using the response sample at <Users | Qlik Developer Portal>
HttpClient Client = new();
Client.BaseAddress = new Uri(sAPIURL);
Client.DefaultRequestHeaders.Clear();
Client.DefaultRequestHeaders.Add("Authorization", "Bearer " + sAPIKey);
//Client.Content.Add("Content-Type", "application/json");
sCommand = "users";
HttpResponseMessage Response = Client.GetAsync(sCommand).Result;
// Check for Success
if (Response.IsSuccessStatusCode)
{
QlickRestClasses.QlikUserList QUsers;
QUsers = Response.Content.ReadFromJsonAsync<QlickRestClasses.QlikUserList>().Result;
}
Adding multiple users at a time preemptively could be accomplished using the Create User API: https://qlik.dev/apis/rest/users#%23%2Fentries%2Fv1%2Fusers-post
The better option would probably be to utilize Groups/Security Groups in your Managed Spaces so that as long as your new users are part of the correct Group in Azure AD, they will have Managed Spaces permissions when they log in and begin interacting with the platform:
https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Spaces/sharing-content-w...
I would love to use an API but the developer toolkit is only for Python and some other language i do not speak. I cannot find any .NET examples. Since I am using Qlik Cloud, the Group Option is not available.
As long as your group claim is configured correctly for your Azure IDP and this setting is checked, Groups from Azure will be associated with your users.
You can check these with the following endpoint in your browser:
https://<your-tenant-here >/api/v1/groups
This will show what groups your user is part of.
And here i've added one of my Azure AD groups to my Managed Space:
Ate there any .net examples for using the API. I want to add Qlick User management to our current user management platform.
I would still suggest utilizing groups within Qlik Cloud, but if you want to go down .NET/API route, you may want to check out Qlik CLI: https://qlik.dev/libraries-and-tools/qlik-cli
Using groups or not, I would still like some samples for using .NET (Not ASP .NET) either in C# or VB.
how does a command line interface help me with my .NET winforms appilcation? Is it written in c# using .NET