Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

134
Visualizações
Find Attendees of an Event

I am trying to display events from a "public" google calendar. My requirement is to get the number of attendees (not necessarily the names of the attendees). However, when I get the events using the Calendar API (using an API Key and CalendarID); the event is missing the whole attendees section that is mentioned here.

My question: Do I need to be authenticated ? Does this mean this can't be public, and the web-pages that displays this information will need the "viewer" to authenticate to Google first?

Here is a snippet of my code (edited)...

$.ajax({
  type: 'GET',
  url: encodeURI('https://www.googleapis.com/calendar/v3/calendars/' + calendarId+ '/events?key=' + myKey),
  dataType: 'json',
  success: function (response) {
    console.log(response);
    //here is where I need to get the number of participants
  },
  error: function (error) {
    console.log(error);
    //tell that an error has occurred
  }

Here is the output...

{kind: 'calendar#events', etag: '"p324e9j5nqabva0g"', summary: 'EDWC Schedule', description: '', updated: '2022-01-04T08:09:10.933Z', …} accessRole: 'reader' defaultReminders: (0) [] description: '' etag: '""' items: (2) [{…}, {…}] 0: {kind: 'calendar#event', etag: '""', id: '', status: 'confirmed', htmlLink:…} 1: {kind: 'calendar#event', etag: '""', id: '', status: 'confirmed', htmlLink:…} conferenceData: {} created: '' creator: {} description: '' end: {dateTime: '2022-01-08T16:00:00+11:00', timeZone: 'Australia/Sydney'} etag: '' eventType: 'default' hangoutLink: '' htmlLink: '' iCalUID: '' id: '' kind: 'calendar#event' location: 'Australia' organizer: {email: '', displayName: '', self: true} sequence: 0 start: {dateTime: '2022-01-08T13:00:00+11:00', timeZone: 'Australia/Sydney'} status: 'confirmed' summary: '' updated: '2022-01-04T08:09:10.933Z' [[Prototype]]: Object [[Prototype]]: Object length: 2 [[Prototype]]: Array(0) kind: 'calendar#events' nextSyncToken: 'CIjkzLfSl_UCEAAYASCvg6XIAQ==' summary: '' timeZone: 'Australia/Melbourne' updated: '2022-01-04T08:09:10.933Z' [[Prototype]]: Object

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

  • As per your question, the answer is yes. Every request sent to the Google Calendar API must include an authorization token. Now, that authorization does not always entail a consent screen, it can also be a short-lived access token or an API key (like in your example). I would encourage you to read more about the authorization process here.
  • As per your code snippet and response, the events list is located inside the items property of the response object. Here you can find how the response object is structured, but in a nutshell, you can access the events by looping through the items like this:
for (var event of response['items']){}
over 4 years ago · Santiago Trujillo Relatório

0

You can accomplish this using the Google Api Node.js Client in this manner:

Google Calendar Event Attendees                                                                                 Run in Fusebit
const calendarClient = googleClient.calendar('v3');

// Update the below fields with your desired values
const calendarId = 'YOUR_CALENDAR_ID';
const eventId = 'YOUR EVENT_ID';

const response = await calendarClient.events.get({
  calendarId,
  eventId,
});

const attendees = response.data.attendees;
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda