tmgoerger
tmgoerger

Reputation: 1

Trying to change a username in Python Google Admin SDK

I'm trying to change a username using the Admin SDK. I'm trying the following code to update this, using a dict object to store the new info, and using patch to update:

userinfo['primaryEmail'] = D['new_user'] + '@' + D['domain']

appsservice.users().patch(userKey = userEmail, body=userinfo)

It doesn't seem to be working, when I look at the admin console. The original username remains unchanged. I'm just wondering if I'm using the correct method. Should I be updating a different variable than primaryEmail or without using the domain affiliation? Seems like I'm just missing something rather obvious.

Thanks,

Tom

Upvotes: 0

Views: 187

Answers (1)

Jay Lee
Jay Lee

Reputation: 13528

Add:

.execute()

To the end of the 2nd line to actually execute the api operation.

Upvotes: 1

Related Questions