cancel
Showing results for 
Search instead for 
Did you mean: 

How to properly delete a user Worskspace using REST API?

Arnault_
Confirmed Champ
Confirmed Champ

Bonjour

J'utilise REST API pour supprimer un user. Mais je voudrais nettoyer le compte.

  1. je crée un User via REST API:
  2. je vérifie la création en lisant le Workspace et le UserProfile
  3. je supprime le User
  4. les documents Workspace et UserProfile existent toujours et sont dans le même état
  5. je supprime le Workspace
  6. je RE-CREE le même User (même paramètres)
  7. mais le UserProfile n'a pas été créé!!!

voici le log de la séquence:

Première séquence de 1 à 5:

>>>>check if user exists
404
>>>> create user
----------query on Workspace for user
SELECT * FROM Document WHERE ecm:path STARTSWITH '/default-domain/UserWorkspaces/' and dc:title = 'qqqq@lal.in2p3.fr'
==> ws uid=85eadbef-e345-4306-b38b-8b035dd4d5aa state=project
----------query on UserProfile
SELECT * FROM UserProfile WHERE ecm:path STARTSWITH '/default-domain/UserWorkspaces/qqqq-lal-in2p3-fr'
==> up uid=2fd7bc21-5aca-4405-93e7-c5a1ae7ee86a state=undefined
>>>> delete user qqqq@lal.in2p3.fr
-------- destruction de WS
----------query on Workspace for user
SELECT * FROM Document WHERE ecm:path STARTSWITH '/default-domain/UserWorkspaces/' and dc:title = 'qqqq@lal.in2p3.fr'
no workspace

Deuxième séquence à partir de 6:

>>>>check if user exists
404
>>>> create user
----------query on Workspace for user
SELECT * FROM Document WHERE ecm:path STARTSWITH '/default-domain/UserWorkspaces/' and dc:title = 'qqqq@lal.in2p3.fr'
==> ws uid=3b0a3781-a727-4c95-b0df-3d1271ea5056 state=project
----------query on UserProfile
SELECT * FROM UserProfile WHERE ecm:path STARTSWITH '/default-domain/UserWorkspaces/qqqq-lal-in2p3-fr'
no profile

===> Mais si je change la séquence en ne supprimant pas le Workspace, alors tout se passe bien, la recréation est correcte

Donc: la question est : comment nettoyer un compte après sa suppression?

Merci de vos conseils

Christian

4 REPLIES 4

Pradeep_Bhat
Star Contributor
Star Contributor

Arnault_
Confirmed Champ
Confirmed Champ

Hi

Thanks a lot for this answer

I'll make some tests about your suggestion.

Indeed it's seems correct

Regards Christian

Most welcome. Accept the answer if it helped you

There s a blog entry about that subject mentionning a dedicated REST API for managing users (/api/v1/user/)

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.