使用 google directory API 时无法创建别名

我的代码如下所示。我的问题是,当我尝试更新“别名”字段时,它不会发生。我的实现有什么问题?


store = file.Storage('token.json')

creds = store.get()

if not creds or creds.invalid:

    flow = client.flow_from_clientsecrets('credentials.json', SCOPES)

    creds = tools.run_flow(flow, store)

service = build('admin', 'directory_v1', http=creds.authorize(Http()))


body = { "name":{"familyName": "Aaab", "givenName": "Aaab"}, "password": "test@test", "primaryEmail": "testAAb@aaaa.no", "secondaryEmail": "test@gmail.com", 'aliases': ['testLeader@test.com']}

user_add = service.users().insert(body=body).execute()

使用其字段创建的用户:


    {'kind': 'admin#directory#user', 'id': '106377021897584806221', 'etag': '"TN30oD80QTVK45AAxvl_wbzs4vs/4WNsaqcVI4y7ARsciDEXH7K8Hh4"', 'primaryEmail': 'testaab@test.no', 'name': {'givenName': 'Aaab', 'familyName': 'Aaab', 'fullName': 'Aaab Aaab'}, 'isAdmin': False, 'isDelegatedAdmin': False, 'lastLoginTime': '1970-01-01T00:00:00.000Z', 'creationTime': '2018-10-24T16:43:27.000Z', 'agreedToTerms': True, 'suspended': False, 'archived': False, 'changePasswordAtNextLogin': False, 'ipWhitelisted': False, 'emails': [{'address': 'testaab@test.no', 'primary': True}], 'customerId': 'C02dcimb3', 'orgUnitPath': '/', 'isMailboxSetup': True, 'isEnrolledIn2Sv': False, 'isEnforcedIn2Sv': False, 'includeInGlobalAddressList': True}


RISEBY
浏览 114回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python