Google Calendar API for multiple users: - google-api

I am developing a web app in Ruby on Rails for registering talks given in my company. If a user registers for a talk, then it should update the Google Calendar event for all users who have the event on their Google Calendar.
https://developers.google.com/accounts/docs/OAuth2
I need to use OAuth2 since I need to modify the user's data and I need to obtain the consent from the user as well. So I can redirect them to the Authentication page where they can sign in to view their account. But in this case the user data I want to modify is Calendar of all those people who signed up for the event.
Is there any easy way to do this? Like using an admin account?

When you want to update the Google Calendar event for all users who already have event in their calendar, you no need to use OAUTH as user authentication is not required.
This is because, when there is an update in the existing event then all the users (who are all already added as attendee in the existing event) calendar gets updated without users consent screen.

Related

is there a way to make events on google calendar into accounts signed with OAuthv2.0 on a CMS laravel website

sorry if this question is not sraightforward. I searched a lot and didn't find the result I want.
I have a CMS website which a specific role of user can link their account on the website to a google account by OAuth. I want to create event in user's calendar from by a form in my website. Now I have set the Oauth and I've created a form that creates events in my developer account.
All i found is creating events on developer account. I found one exactly like I want but in electron not laravel

Google API to view any user's calendar list

I am using Google API to try to view a user's calendar list, mainly the shared calendars a user had access to. But according to the Google Calendar.List api , I can view only the logged user's calendar. So I wanted to ask if there is a way around this.
The use case that I am working on requires removing any shared calendars of a user whose status has been changed to suspended.
Thanks
DS

google calendar create event without user logging in

Is it possible to create an event on behalf of my own application?
I tried using API Key but that doesn't work. I want all the event to be under my app's account. I don't want to make the user login. I just want to create new google Meet links.
No you must be authorized to write to a users calendar
if you check the documentation for events.insert you will notice a section called authorization
This section tells you what authorization scopes you need in order to be able to write to a users google calendar. A user must grant your application access to their data before your application will be able to write to it.
API keys are only used for accessing public data, for example the public google calendar holiday calendars you can read from them with an api key.
However to access private user data you need to be authorized.

Access entire gsuite domain calendar events

I want to access the entire events existing in a calendar of a gsuite domain. I tried using domain deligation with service account and it allows me to assume a user and get all of its events but i want to fetch the entire events in a gsuite account.
In order to achieve your task, you should create a service account which impersonates the admin of the domain.
Afterwards, you can retrieve the users of the domain by making use of the Admin SDK.
GET https://admin.googleapis.com/admin/directory/v1/users
Based on the list you get, you can get the events from the calendar of each user.
GET https://www.googleapis.com/calendar/v3/calendars/calendarId/events
Where, calendarId is the email of one of the users from the domain.
Reference
Admin SDK users.list;
Calendar API events.list.

add calendar to another user's calendar list

Not sure if this is possible or if anyone has managed to do this. I have user with super admin access, with which I can create a new user for my domain. However I also want to add a couple of calenders to the created user's calendar list. When I create a user I authenticate using my super admin, but then I can't add a calendar to the user's calendar list since I am not logged in as the user. Is it possible to do this as the super admin, or do I have to logout and authenticate as the created user in order to add calendars to their list? This is the base url to which the post request is made:
https://www.googleapis.com/calendar/v3/users/me/calendarList
in the place of me could I pass in the id of the user? I couldn't find any parameter in the documentation with which I can specify the user to whose list I want to add a calender.
Thanks
Two options:
Each user much login to google calendar and share thier calendar to a single user. You can then use this account to update their calendars. Note that google has limitations to how many calendars and request you are allowed before the account goes to read-only mode.
Buy a google apps domain (5$per user per month) and create a service account at console.developers.google.com. Create a project and give it domain wide delgation at admin.google.com. In Apps engine you should be able to give access for admin to modify all users calendars.
No matter what case you choose, you also need to enable CalendarAPI at dev console site. Now with private key created from website request OAuth2 access token, where sub field is set for the users that you want to change calendar for. With returned access token use CalendarAPI to modify calendar.
Sry for bad english and short description, i'm in a hurry. /conner ;)

Resources