Reputation: 37
Did anyone used undelete command to restore the deleted users using google admin SDK API in google workspace ?
https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/undelete
I want to undelete a user who is recently delete but the command requires a {userKey}, is string (The immutable id of the user), which i don't know where and how to find out:
HTTP request
POST https://admin.googleapis.com/admin/directory/v1/users/{userKey}/undelete
Can anyone help me with below :
Thanks in advance for any help.
I have tried deleting a user, where it only requires "Email address" as identifier. I have tried to get users details, where it only requires "Email address" as identifier.
But when i try to undelete, using "email address" as userkey it doesn't recognise that user as it is already deleted.
Upvotes: 0
Views: 296
Reputation: 777
users.list
methodUnlike the delete method, you cannot use the user's email address in the userKey
field when restoring them. You would have to use the 21-character userID instead. On the users.list method, specify your domain name on the domain
field and enter true on the showDeleted
field to filter the deleted users.
In addition, I recommend specifying the orgUnitPath
when running the users.undelete
method.
Upvotes: 1