Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
millnet-maho
Partner - Contributor III
Partner - Contributor III

Repository Service: DELETE /qrs/user/{id} returns 405 error

Has anyone managed to use the QRS REST API to delete a user? Or GET one, for that matter? I've managed to look up a specific user by userDirectory and userId via a filter parameter, but DELETE /qrs/user/{id}, where {id} is the UUID in the id property of the returned user object, returns 405, and GET /qrs/user/{id} returns 404. According to the API reference, those methods should be possible and I am using the right id, aren't I?

https://help.qlik.com/en-US/sense-developer/June2019/APIs/repositoryserviceapi/index.html?page=219

(I'm exploring managing the user directories without setting up User Directory Connectors.)

Labels (2)
1 Solution

Accepted Solutions
millnet-maho
Partner - Contributor III
Partner - Contributor III
Author

Sorry, I realised that I had dropped "/qrs" from the path in the DELETE while figuring out what headers are needed and what the id is. I had included it earlier. I got it to work now.

View solution in original post

4 Replies
Levi_Turner
Employee
Employee

The 405 is very odd to the DELETE command. But it's also odd that you get a 404 for the GET command.

Expected:

  • GET /qrs/user/{id}
    • Response: 200 with the body being the user's record
  • DELETE /qrs/user/{id}
    • Response: 204

If you can't do a GET then a DELETE will obviously fail. How are you getting the user's ID?

millnet-maho
Partner - Contributor III
Partner - Contributor III
Author

GET to /qrs/user?filter=...&Xrfkey=...

I get [{"id":"ae862dd0-da37-4e36-92bb-819843d01bc1","userId":"1","userDirectory":"MAHO-DEV","name":"Test Person","privileges":null}] back, and I assume that ae862dd0-da37-4e36-92bb-819843d01bc1 is the id to append to the path to DELETE that user. If the above GET works, I shouldn't have to add any additional X-Qlik headers for DELETE to work, should I? I'm not trying to delete an internal user or a user from the local Windows domain or anything either. I tried deleting the UDC but that didn't help.

Levi_Turner
Employee
Employee

I get [{"id":"ae862dd0-da37-4e36-92bb-819843d01bc1","userId":"1","userDirectory":"MAHO-DEV","name":"Test Person","privileges":null}] back, and I assume that ae862dd0-da37-4e36-92bb-819843d01bc1 is the id to append to the path to DELETE that user.

Correct. That's the ID for the user.

> If the above GET works, I shouldn't have to add any additional X-Qlik headers for DELETE to work, should I?

Nope. Standard headers

millnet-maho
Partner - Contributor III
Partner - Contributor III
Author

Sorry, I realised that I had dropped "/qrs" from the path in the DELETE while figuring out what headers are needed and what the id is. I had included it earlier. I got it to work now.