我正在使用Calendar API,当我调用
event['creator'].get('email')
我总是收到电子邮件,并且一切正常。
当我打电话
event['creator'].get('displayName')
要么
event['organizer'].get('displayName')
两者的结果相同(没关系),但有时得到正确的结果(名称和姓氏),有时得到“ null”或“ none”。
我注意到可以为用户添加Google+个人资料来解决此问题,添加G +个人资料后,响应将提供正确的名称和姓氏,但这不是适合我们的解决方案。 在Google日历中,可以正确显示每个事件所有者的姓名和姓氏。 我从这里开始:https://developers.google.com/calendar/quickstart/python
for event in events:
start = event['start'].get('dateTime',event['start'].get('date'))
print(start,
event['summary'],
event['creator'].get('email'),
event['creator'].get('displayName'),
event['organizer'].get('displayName'))
我希望创建者的显示名称与Google日历事件中显示的显示名称相同,而不是=“ none”。
示例。
我想要什么: 09.00 GMT + 2,示例事件,john.doe @ test.com,John Doe,John Doe
我所拥有的: 09.00 GMT + 2,示例事件,john.doe @ test.com,无,无
Event from calendar is displaying my name
API Response is showing "none" "none" instead of my username