0
votes

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.

As it turns out, G Suite users don't have a displayName parameter but resources and standard Google Calendar users do.

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": "[email protected]"
   },
   "organizer": {
    "email": "[email protected]",
    "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": "[email protected]",
   "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": "[email protected]",
    "displayName": "John Doe",
    "self": true
   },
   "organizer": {
    "email": "[email protected]",
    "displayName": "John Doe",
    "self": true
   },
   "start": {
    "dateTime": "2018-02-27T08:00:00-05:00"
   },
   "end": {
    "dateTime": "2018-02-27T09:00:00-05:00"
   },
   "iCalUID": "[email protected]",
   "sequence": 0,
   "reminders": {
    "useDefault": true
   }
  }

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": "[email protected]",
    "self": true
   },
   "organizer": {
    "email": "[email protected]",
    "self": true
   },
   "start": {
    "dateTime": "2018-02-27T07:30:00-08:00"
   },
   "end": {
    "dateTime": "2018-02-27T08:00:00-08:00"
   },
   "iCalUID": "[email protected]",
   "sequence": 0,
   "reminders": {
    "useDefault": true
   }

Am I missing something? Why don't G Suite users have the displayName parameter by default?

1
Did you try providing displayName (just follow correct format) in the "fields parameter"? You can also try providing "*" to indicate you want every property returned. - noogui
If I limit it to just the summary and organizer.displayName it returns just the summary and a null value for the displayName. I notice the API says "returns the organizer's name, if available" but I can't figure out what makes it available or not. - Mogarrr
'not available' may mean the 'organizer's name' has not been provided. - noogui

1 Answers

0
votes

To anyone else who is struggling with this-

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.

Once the G+ profile is set up the displayName will be available.