<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: QRS API : Allocate license access in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1918013#M16615</link>
    <description>&lt;P&gt;It worked when I gave an admin role (repository access) to my api user.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Apr 2022 12:22:18 GMT</pubDate>
    <dc:creator>MostafaFares55</dc:creator>
    <dc:date>2022-04-13T12:22:18Z</dc:date>
    <item>
      <title>QRS API : Allocate license access</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1576476#M10455</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would like to allocate analyzer (or profesional) access with the QRS API.&lt;/P&gt;&lt;P&gt;I am trying to do it according to that documentation&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense-developer/February2019/APIs/repositoryserviceapi/index.html?page=1207" target="_blank"&gt;https://help.qlik.com/en-US/sense-developer/February2019/APIs/repositoryserviceapi/index.html?page=1207&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(which unfortunately does not contains an example of the request body to send)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sending a POST request to&amp;nbsp;&lt;A href="https://my-qlik-server:4242/qrs/license/analyzeraccesstype?Xrfkey=xbZdef9hijkPxn4P" target="_blank"&gt;https://my-qlik-server:4242/qrs/license/analyzeraccesstype?Xrfkey=xbZdef9hijkPxn4P&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Body :&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"modifiedByUserName": "INTERNAL\\sa_repository",&lt;BR /&gt;"modifiedDate": "2019-05-03T17:23:02.316Z",&lt;BR /&gt;"user": {&lt;BR /&gt;"userDirectory": "AZ-XXX",&lt;BR /&gt;"userId": "2db75108-922f-4736-8461-a7ec7c1edda2"&lt;BR /&gt;},&lt;BR /&gt;"createdDate": "2019-05-03T17:23:02.315Z"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, in return, I get a HTTP 400 (bad request)&lt;/P&gt;&lt;P&gt;Could you please provide the body that must be passed to make it work ?&lt;/P&gt;&lt;P&gt;Is there any logs in QlikSense giving more details about what is bad in the request ?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;JF&lt;/P&gt;&lt;P&gt;PS : I have other QRS APIs calls working fine, the problem is specific to that API. Certificate authentication is OK and HTTP headers like Xrfkey&amp;nbsp; are passed correctly...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 05:55:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1576476#M10455</guid>
      <dc:creator>jeff007</dc:creator>
      <dc:date>2024-11-16T05:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: QRS API : Allocate license access</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1582750#M10592</link>
      <description>&lt;P&gt;On my end, I am able to do it using this:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Endpoint: POST /qrs/license/analyzeraccesstype&lt;/LI&gt;
&lt;LI&gt;Body:&amp;nbsp;{"user": {"id": "9309c057-97c3-4f42-8e86-65b170675c32"}}
&lt;UL&gt;
&lt;LI&gt;Where the ID refers to the UserID&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;From your end, you shouldn't need the&amp;nbsp;&lt;SPAN&gt;modifiedByUserName,&amp;nbsp;modifiedDate, or&amp;nbsp;createdDate elements since the entity doesn't exist yet. The QRS will add those as needed.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 13:03:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1582750#M10592</guid>
      <dc:creator>Levi_Turner</dc:creator>
      <dc:date>2019-05-21T13:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: QRS API : Allocate license access</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1582770#M10594</link>
      <description>&lt;P&gt;Hi Levi,&lt;/P&gt;&lt;P&gt;Thanks for your support, unfortunately I still have the same HTTP 400 as a response (I probably already tested that body before)&lt;/P&gt;&lt;P&gt;But it's already a good thing to know that this request is working on your end !&lt;/P&gt;&lt;P&gt;Do you know if there is any log files on Qlik Sense that could help ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 13:19:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1582770#M10594</guid>
      <dc:creator>jeff007</dc:creator>
      <dc:date>2019-05-21T13:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: QRS API : Allocate license access</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1582803#M10596</link>
      <description>&lt;P&gt;I am not seeing an obvious one. What is the actual response? For example on my end&amp;nbsp;"errorText": "Violation of the uniqueness constraint" comes when I try to allocate a user an Analyzer pass when they already have one.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 13:39:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1582803#M10596</guid>
      <dc:creator>Levi_Turner</dc:creator>
      <dc:date>2019-05-21T13:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: QRS API : Allocate license access</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1582814#M10599</link>
      <description>&lt;P&gt;Thanks, I had not thought to read the body of the message when when the HTTP response code was not normal ...&lt;/P&gt;&lt;P&gt;Now I can better understand !&lt;/P&gt;&lt;P&gt;Have a good day !&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 13:49:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1582814#M10599</guid>
      <dc:creator>jeff007</dc:creator>
      <dc:date>2019-05-21T13:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: QRS API : Allocate license access</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1659728#M12038</link>
      <description>&lt;P&gt;Hi Jeff,&lt;/P&gt;&lt;P&gt;Were you able to solve "&lt;SPAN&gt;HTTP 400 (bad request)&lt;/SPAN&gt;" exception?&lt;/P&gt;&lt;P&gt;I am getting the same error.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rytis&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2019 11:38:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1659728#M12038</guid>
      <dc:creator>rytisgasparavic</dc:creator>
      <dc:date>2019-12-20T11:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: QRS API : Allocate license access</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1659776#M12039</link>
      <description>&lt;P&gt;Hi Rytis,&lt;/P&gt;&lt;P&gt;Yes, I could find more details when looking at the body of the HTTP response.&lt;/P&gt;&lt;P&gt;I think it was because the user already had a license.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2019 13:29:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1659776#M12039</guid>
      <dc:creator>jeff007</dc:creator>
      <dc:date>2019-12-20T13:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: QRS API : Allocate license access</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1661364#M12055</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN&gt;Jeff,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Understood, I am seeing a detailed error in response as well now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Rytis&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2019 09:33:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1661364#M12055</guid>
      <dc:creator>rytisgasparavic</dc:creator>
      <dc:date>2019-12-30T09:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: QRS API : Allocate license access</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1917453#M16609</link>
      <description>&lt;P&gt;Dears,&lt;/P&gt;
&lt;P&gt;When I try to use QRS-API&amp;nbsp; to give an analyzer access to a user&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;post /license/analyzeraccesstype&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;* I am testing with a virtual proxy - header authentication static user directory in QMC.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;It shows "&lt;FONT color="#993300"&gt;No matching endpoint found&lt;/FONT&gt;"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MostafaFares55_0-1649767852321.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/76896i4FCBD2E09867427F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MostafaFares55_0-1649767852321.png" alt="MostafaFares55_0-1649767852321.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I use&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense-developer/February2019/APIs/repositoryserviceapi/index.html?page=986" target="_blank" rel="noopener"&gt;Open API specification for Repository Main API&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please, help. &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/47469"&gt;@Levi_Turner&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 20:58:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1917453#M16609</guid>
      <dc:creator>MostafaFares55</dc:creator>
      <dc:date>2022-04-12T20:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: QRS API : Allocate license access</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1918013#M16615</link>
      <description>&lt;P&gt;It worked when I gave an admin role (repository access) to my api user.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 12:22:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/1918013#M16615</guid>
      <dc:creator>MostafaFares55</dc:creator>
      <dc:date>2022-04-13T12:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: QRS API : Allocate license access</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/2048087#M18248</link>
      <description>&lt;P&gt;Script Powershell:&lt;/P&gt;
&lt;P&gt;$hdrs = @{}&lt;BR /&gt;$hdrs.Add("X-Qlik-xrfkey","12345678qwertyui")&lt;BR /&gt;$hdrs.Add("X-Qlik-User","UserDirectory=xxxx;UserId=xxxxx")&lt;BR /&gt;$hdrs.Add("Content-Type","application/json")&lt;BR /&gt;$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}&lt;BR /&gt;$body = '{"user":{"id":"244ee0d3-7ee1-42bc-b3ac-f30787dd6d3b"}}'&lt;BR /&gt;$url2 = "https://&amp;lt;sense server&amp;gt;:4242/qrs/license/professionalaccesstype?xrfkey=12345678qwertyui"&lt;BR /&gt;Invoke-RestMethod -Uri $url2 -Method Post -Headers $hdrs -Certificate $cert -Body $body&lt;/P&gt;
&lt;P&gt;Analyzer licenses, replace "professionalaccesstype" to "analyzeraccesstype"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 19:25:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/2048087#M18248</guid>
      <dc:creator>makunii</dc:creator>
      <dc:date>2023-03-10T19:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: QRS API : Allocate license access</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/2049232#M18263</link>
      <description>&lt;P&gt;if you use the PowerShell Module&amp;nbsp;&lt;A href="https://github.com/QlikProfessionalServices/QlikSenseCLI" target="_blank" rel="noopener"&gt;QlikSenseCLI&lt;/A&gt;&amp;nbsp;you can easily extend this&lt;/P&gt;
&lt;P&gt;by setting the UserID &amp;amp; UserDirectory values the following script will look for the user in Qlik Sense, if the User does not exist it will be create and then you can assign the license. (that way you don't need to know their GUID id)&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;#Get the QlikClient Certificate
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where-Object { $_.Subject -eq 'CN=QlikClient' } | Sort-Object -Property NotAfter | Select-Object -First 1

#Connect to Qlik Sense QRS
Connect-QlikSense -Certificate $cert -Username "Internal\sa_api"

$UserID = 'QlikMarc'
$UserDirectory = $env:USERDOMAIN
#Get the User (-Filter Always returns an array)
$user = Get-QSUser -Filter "userid eq '$($UserID)' and userdirectory eq '$($UserDirectory)'"

#If there is no user found create the user 
if ($user.Count -eq 0) { $Null = Add-QSUser -UserObj $(New-QSUser -UserId $UserID -UserDirectory $UserDirectory); $user = Get-QSUser -Filter "userid eq '$($UserID)'" }

#then assign a license
#Analyzer
$AAccessType = $user | ForEach-Object{ New-QSLicenseAnalyzerAccessType -User $_ }
Add-QSLicenseAnalyzeraccesstype -Many -LicenseAnalyzerAccessTypeObjs $AAccessType

#Professional
$PAccessType = $user | ForEach-Object{ New-QSLicenseProfessionalAccessType -User $_ }
Add-QSLicenseProfessionalaccesstype -Many -LicenseProfessionalAccessTypeObjs $PAccessType&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively you can set it to Assign a professional license only if the user exists and does not already have a license of the type assigned&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;#https://github.com/QlikProfessionalServices/QlikSenseCLI
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where-Object { $_.Subject -eq 'CN=QlikClient' } | Sort-Object -Property NotAfter -Descending | Select-Object -First 1
Connect-QlikSense -Certificate $cert -Username "Internal\sa_api"

$UserID = 'QlikMarc'
$UserDirectory = $env:USERDOMAIN
$user = Get-QSUser -Filter "userid eq '$($UserID)' and userdirectory eq '$($UserDirectory)'"
if ($user.Count -gt 0) {
	$user | ForEach-Object{
		$existing = Get-QSLicenseProfessionalaccesstype -Filter "user.userid eq '$($UserID)' and user.userdirectory eq '$($UserDirectory)'"
		if ($existing.Count -eq 0) {
			$PAccessType = $user | ForEach-Object{ New-QSLicenseProfessionalAccessType -User $_ }
			Add-QSLicenseProfessionalaccesstype -Many -LicenseProfessionalAccessTypeObjs $PAccessType
		}
	}
}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 23:20:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/QRS-API-Allocate-license-access/m-p/2049232#M18263</guid>
      <dc:creator>Marc</dc:creator>
      <dc:date>2023-03-14T23:20:50Z</dc:date>
    </item>
  </channel>
</rss>

