0

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

PiotrWolkowski
  • 8,408
  • 6
  • 48
  • 68

1 Answers1

1

Add:

.execute()

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

Jay Lee
  • 13,415
  • 3
  • 28
  • 59