Skip to content

I m trying to Impersonating users from admin in Calendar #1452

@vinothmoorthkumar

Description

@vinothmoorthkumar

Hi,
I m trying to Impersonating users from admin in Calendar, i provided all required access to this resource still i m getting 404 Not found error unless sharing calendar to specific person option from the user side. Can any give me example or solution to solve this issue.

const { google } = require('googleapis');
const calendar = google.calendar('v3');
const key = require('./gsuite.json');
const CALENDAR_ID = 'xxxx@example.com';
const jwtClient = new google.auth.JWT(
    key.client_email,
    null,
    key.private_key,   
  ['https://www.googleapis.com/auth/admin.directory.user','https://www.googleapis.com/auth/calendar'],
    key.client_email
);
jwtClient.authorize(function (err, tokens) {
    if (err) {
        console.log(err);
        return;
    }
});

  // Make an authorized request to list Calendar events.
    calendar.events.list({
        auth: jwtClient,
        calendarId: CALENDAR_ID
    }, function (err, resp) {
        console.log(err)
        res.send(resp.data);
    });

Metadata

Metadata

Labels

needs more infoThis issue needs more information from the customer to proceed.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions