我正在遵循指南: https ://developers.google.com/people/v1/write-people
我的代码:
def main():
"""Shows basic usage of the Google People API
"""
credentials = get_credentials()
http = credentials.authorize(httplib2.Http())
service = discovery.build('people', 'v1', http=http,
discoveryServiceUrl='https://people.googleapis.com/$discovery/rest')
contact2 = service.people().createContact(
body={"names": [{"givenName": "John", "familyName": "Doe"}]}).execute()
contact2()
if __name__ == '__main__':
main()
当我运行时,我的错误:
~/quickstart.py
Traceback (most recent call last):
File "~/quickstart.py", line 77, in <module>
main()
File "~/quickstart.py", line 66, in main
contact2()
TypeError: 'dict' object is not callable
Process finished with exit code 1
我收到这个错误。如何有效地创建新联系人?