만들기 : https://developers.google.com/people/v1/write-people내가 가이드 다음 한 새로운 Google에 문의 사람들 API
내 코드 :
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
나는이 오류를 얻고있다 . 새 연락처를 효과적으로 만드는 방법은 무엇입니까?
전체 추적을 제공해주십시오. 그 오류는 코드의 도처에서 발생할 수 있습니다. –
전체 추적이라고 생각합니다. –
contact2는 사전이 아니며 함수가 아니기 때문에 호출 할 수 없습니다. 나는 API를 모른다. 그러나''execute()''메소드는 요청에 대한 응답을 담은 사전을 리턴한다. –