G Suite帐户在Calendar API中缺少displayName参数 [英] G Suite Account missing displayName parameter in Calendar API
问题描述
我正在创建一个应用程序,该应用程序使用其API从Google日历获取日历事件.但是,我无法获取G Suite帐户的creator.displayName参数.为了排除代码中的错误,我只是从calendar.google.com网站创建了一个日历事件,然后转到API资源管理器(
I am creating an application that gets calendar events from Google Calendar using their API. I am not able to get the creator.displayName parameter for G Suite accounts, however. To rule out that it was something in my code I simply created a calendar Event from the calendar.google.com site and went to the API Explorer (https://developers.google.com/apis-explorer/#p/calendar/v3/calendar.events.list) to look at the event.
事实证明,G Suite 用户没有displayName参数,但是资源和标准Google日历用户拥有.
As it turns out, G Suite users don't have a displayName parameter but resources and standard Google Calendar users do.
对于G Suite 资源帐户,我得到类似的信息:
For a G Suite Resource account I get something like:
{
"kind": "calendar#event",
"etag": "\"123456789220000\"",
"id": "<unique-ID-here>",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=unique-eid-link-here",
"created": "2018-02-27T13:00:07.000Z",
"updated": "2018-02-27T13:00:07.160Z",
"summary": "Event Name",
"creator": {
"email": "admin@gsuitedomain.com"
},
"organizer": {
"email": "gsuitedomain.com_uniqueidentifier@group.calendar.google.com",
"displayName": "A Resource Account",
"self": true
},
"start": {
"dateTime": "2018-02-27T05:52:00-08:00"
},
"end": {
"dateTime": "2018-02-27T06:00:00-08:00"
},
"iCalUID": "unique-uid-here@google.com",
"sequence": 0,
"reminders": {
"useDefault": true
}
对于个人帐户,我得到:
And for a personal account I get:
{
"kind": "calendar#event",
"etag": "\"1234567890015265\"",
"id": "unique-id-here",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=unique-eid-here",
"created": "2018-02-27T13:00:04.000Z",
"updated": "2018-02-27T13:00:05.014Z",
"summary": "Event Name 2",
"creator": {
"email": "personal-gmail@gmail.com",
"displayName": "John Doe",
"self": true
},
"organizer": {
"email": "personal-gmail@gmail.com",
"displayName": "John Doe",
"self": true
},
"start": {
"dateTime": "2018-02-27T08:00:00-05:00"
},
"end": {
"dateTime": "2018-02-27T09:00:00-05:00"
},
"iCalUID": "unique-id-here@google.com",
"sequence": 0,
"reminders": {
"useDefault": true
}
}
在组织者下显示名称明显的位置.但是对于管理员或GSuite中的任何用户,我都会得到以下信息:
Where the displayName is apparent under the organizer. But for the admin or any user in the GSuite I get the following:
{
"kind": "calendar#event",
"etag": "\"123459678950000\"",
"id": "unique-id-here",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=unique-eid-here",
"created": "2018-02-27T14:00:14.000Z",
"updated": "2018-02-27T14:00:24.391Z",
"summary": "Event Name 3",
"creator": {
"email": "admin@gsuitedomain.com",
"self": true
},
"organizer": {
"email": "admin@gsuitedomain.com",
"self": true
},
"start": {
"dateTime": "2018-02-27T07:30:00-08:00"
},
"end": {
"dateTime": "2018-02-27T08:00:00-08:00"
},
"iCalUID": "unique-id-here@google.com",
"sequence": 0,
"reminders": {
"useDefault": true
}
我错过了什么吗?为什么G Suite用户默认没有displayName参数?
Am I missing something? Why don't G Suite users have the displayName parameter by default?
推荐答案
对任何为此苦苦挣扎的人
To anyone else who is struggling with this-
个人用户身份信息与为该用户创建的Google+个人资料相关联.已为G Suite域启用了Google+,但也必须为每个用户都启用该服务.
Individual user identity information is tied in with the Google+ profile that is created for that user. Google+ is enabled for the G Suite domain but the service has to be enabled for each user as well.
设置了G +个人资料后,displayName将可用.
Once the G+ profile is set up the displayName will be available.
这篇关于G Suite帐户在Calendar API中缺少displayName参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!