Did anyone use
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 deleted but the command requires a {userKey}, is string (The immutable id of the user), which I don't know where and how to find:
HTTP request
POST https://admin.googleapis.com/admin/directory/v1/users/{userKey}/undelete
Can anyone help me with the below:
We need to send a request to find this user's immutable id.
Using that ID, we will be able to undelete it.
Add the user to org A.D.
Any other thing which would be required after that.
Thanks in advance for any help!
What I have tried:
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.