Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

254
Vistas
Google Calendar API not returning attendees when listing events

When retrieving events using the Google Calendar Api v3 the attendees array is not included in the results. I'm authenticating with a service account, so there should be no access restrictions on individual fields.

My request looks like this (authentication code omitted for brevity):

async function fetchEvents() {
  const calendar = google.calendar('v3')
  google.options({ auth: await auth() })

  return await calendar.events.list({
    calendarId:
      '<the-actual-calendar-id>@group.calendar.google.com',
    fields:
      'items(summary,description,attendees)',
    maxAttendees: 99,
    timeMin: new Date().toISOString(),
    maxResults: 5,
    singleEvents: true,
    orderBy: 'startTime'
  })
}

Omitting the fields parameter entirely also doesn't include the attendees although the field is part of the Events Resource.

Likewise, omitting maxAttendees also doesn't change anything.

Following the htmlLink returned from the API, I can verify that a particular event has a list of attendees.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Sounds like you have not set up delegation properly. When you delegate to the user in your workspace domain. That user has access on the domain for the-actual-calendar-id>@group.calendar.google.com

Then you init impersonation with the with_subject .

from google.oauth2 import service_account

SCOPES = ['https://www.googleapis.com/auth/calendar']
SERVICE_ACCOUNT_FILE = '/path/to/service.json'

credentials = service_account.Credentials.from_service_account_file(
        SERVICE_ACCOUNT_FILE, scopes=SCOPES)

delegated_credentials = credentials.with_subject('user@example.org')
about 4 years ago · Juan Pablo Isaza Denunciar

0

As pointed out in DalmTo's answer an event's attendees is a privileged field that can't be retrieved with a service account unless it is used to impersonate the calendar's owner.

Setting up a service account to impersonate a user

  1. Enable domain-wide delegation for the service account in the Admin Console. The OAuth scope required is https://www.googleapis.com/auth/calendar.events.

  2. Use google.auth.JWT to impersonate the user (from this GitHub issue):

  const auth = google.auth.JWT({
    subject: 'user@your-workspace-domain.com',
    keyFile: '/path/to/service-account-keyfile.json',
    scopes: ['https://www.googleapis.com/auth/calendar.events']
  })

  const calendar = google.calendar({ version: 'v3', auth })

  const { data } = await calendar.events.list({ ... })
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda