G Suite 帐户在日历中缺少 displayName 参数 API
G Suite Account missing displayName parameter in Calendar API
我正在创建一个应用程序,它使用 API 从 Google 日历中获取日历事件。但是,我无法获得 G Suite 帐户的 creator.displayName 参数。为了排除它是我代码中的某些东西,我只是从 calendar.google.com 站点创建了一个日历事件,然后转到 API 资源管理器 (https://developers.google.com/apis-explorer/#p/calendar/v3/calendar.events.list) 查看该事件。
事实证明,G Suite 用户 没有显示名称参数,但资源和标准 Google 日历用户有。
对于 G Suite Resource 帐户,我得到如下信息:
{
"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
}
对于个人帐户,我得到:
{
"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
}
}
displayName 显示在组织者下方。但是对于管理员或 GSuite 中的任何用户,我得到以下信息:
{
"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 参数?
对于正在为此苦苦挣扎的任何其他人-
个人用户身份信息与为该用户创建的 Google+ 配置文件相关联。 Google+ 已为 G Suite 域启用,但还必须为每个用户启用该服务。
设置 G+ 配置文件后,displayName 将可用。
我正在创建一个应用程序,它使用 API 从 Google 日历中获取日历事件。但是,我无法获得 G Suite 帐户的 creator.displayName 参数。为了排除它是我代码中的某些东西,我只是从 calendar.google.com 站点创建了一个日历事件,然后转到 API 资源管理器 (https://developers.google.com/apis-explorer/#p/calendar/v3/calendar.events.list) 查看该事件。
事实证明,G Suite 用户 没有显示名称参数,但资源和标准 Google 日历用户有。
对于 G Suite Resource 帐户,我得到如下信息:
{
"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
}
对于个人帐户,我得到:
{
"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
}
}
displayName 显示在组织者下方。但是对于管理员或 GSuite 中的任何用户,我得到以下信息:
{
"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 参数?
对于正在为此苦苦挣扎的任何其他人-
个人用户身份信息与为该用户创建的 Google+ 配置文件相关联。 Google+ 已为 G Suite 域启用,但还必须为每个用户启用该服务。
设置 G+ 配置文件后,displayName 将可用。