Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jeff007
Partner - Contributor
Partner - Contributor

QRS API : Allocate license access

Hi,

I would like to allocate analyzer (or profesional) access with the QRS API.

I am trying to do it according to that documentation https://help.qlik.com/en-US/sense-developer/February2019/APIs/repositoryserviceapi/index.html?page=1...

(which unfortunately does not contains an example of the request body to send)

 

I am sending a POST request to https://my-qlik-server:4242/qrs/license/analyzeraccesstype?Xrfkey=xbZdef9hijkPxn4P

Body : 

{
"modifiedByUserName": "INTERNAL\\sa_repository",
"modifiedDate": "2019-05-03T17:23:02.316Z",
"user": {
"userDirectory": "AZ-XXX",
"userId": "2db75108-922f-4736-8461-a7ec7c1edda2"
},
"createdDate": "2019-05-03T17:23:02.315Z"
}

 

But, in return, I get a HTTP 400 (bad request)

Could you please provide the body that must be passed to make it work ?

Is there any logs in QlikSense giving more details about what is bad in the request ?

Thanks,

JF

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  are passed correctly...

 

 

 

Labels (2)
2 Solutions

Accepted Solutions
Levi_Turner
Employee
Employee

On my end, I am able to do it using this:

  • Endpoint: POST /qrs/license/analyzeraccesstype
  • Body: {"user": {"id": "9309c057-97c3-4f42-8e86-65b170675c32"}}
    • Where the ID refers to the UserID

From your end, you shouldn't need the modifiedByUserName, modifiedDate, or createdDate elements since the entity doesn't exist yet. The QRS will add those as needed.

 

View solution in original post

Levi_Turner
Employee
Employee

I am not seeing an obvious one. What is the actual response? For example on my end "errorText": "Violation of the uniqueness constraint" comes when I try to allocate a user an Analyzer pass when they already have one.

View solution in original post

11 Replies
Levi_Turner
Employee
Employee

On my end, I am able to do it using this:

  • Endpoint: POST /qrs/license/analyzeraccesstype
  • Body: {"user": {"id": "9309c057-97c3-4f42-8e86-65b170675c32"}}
    • Where the ID refers to the UserID

From your end, you shouldn't need the modifiedByUserName, modifiedDate, or createdDate elements since the entity doesn't exist yet. The QRS will add those as needed.

 

jeff007
Partner - Contributor
Partner - Contributor
Author

Hi Levi,

Thanks for your support, unfortunately I still have the same HTTP 400 as a response (I probably already tested that body before)

But it's already a good thing to know that this request is working on your end !

Do you know if there is any log files on Qlik Sense that could help ?

Thanks

Levi_Turner
Employee
Employee

I am not seeing an obvious one. What is the actual response? For example on my end "errorText": "Violation of the uniqueness constraint" comes when I try to allocate a user an Analyzer pass when they already have one.

jeff007
Partner - Contributor
Partner - Contributor
Author

Thanks, I had not thought to read the body of the message when when the HTTP response code was not normal ...

Now I can better understand !

Have a good day !

rytisgasparavic
Partner - Contributor
Partner - Contributor

Hi Jeff,

Were you able to solve "HTTP 400 (bad request)" exception?

I am getting the same error.

Thanks

Rytis

jeff007
Partner - Contributor
Partner - Contributor
Author

Hi Rytis,

Yes, I could find more details when looking at the body of the HTTP response.

I think it was because the user already had a license.

Regards,

Jeff

rytisgasparavic
Partner - Contributor
Partner - Contributor

Thanks Jeff,

Understood, I am seeing a detailed error in response as well now.

Regards,

Rytis

MostafaFares55
Contributor II
Contributor II

Dears,

When I try to use QRS-API  to give an analyzer access to a user

 

post /license/analyzeraccesstype

 

* I am testing with a virtual proxy - header authentication static user directory in QMC.

It shows "No matching endpoint found"

MostafaFares55_0-1649767852321.png

I use Open API specification for Repository Main API 

 

Please, help. @Levi_Turner 

 

 

MostafaFares55
Contributor II
Contributor II

It worked when I gave an admin role (repository access) to my api user.