Google calendar.events.list returns only the attendees 'Email'. displayName and other fields missing

Viewed 283

I have an application that is using Google API Nodejs client. The call to calendar.events.list({ ... }); returns a list of events for the user but it only gives but the 'attendees' array only has the 'email' and 'responseStatus' fields in it.

I want the attendee's name on my app instead of their email because it increases the usability (obviously).

When I look at the particular event in my Google Calendar, it shows the Names of the attendees with a GMail ID. So this means there has to be a way to get the displayName of the attendees with a GMail account.

Here is the code for the call to events.list:

const calendar = google.calendar( { version: 'v3', auth } );
calendar.events.list(
{
    calendarId:   'primary',
    timeMin:      startParam.toISOString(),
    timeMax:      endParam.toISOString(),
    maxResults:   999,
    singleEvents: true,
    orderBy:      'startTime',
    timeZone:     req.query.timeZone
},
(error: any, response: any) => {
    //CallBack
    if ( error ) {
        res.status(500).send( 'The post request returned an error: ' + error );
    }
    else {
        res.status(200).send(response.data.items);
    }
});
0 Answers
Related