Confusion regarding permissions (write access) for the calendar resource - calendar

I have a google account with my company domain. I received super user status so that I can access all the calendars in the workspace. I registered my app and followed oAuth2.0 authorization steps with these scopes -
https://www.googleapis.com/auth/calendar.events
https://www.googleapis.com/auth/admin.directory.resource.calendar
https://www.googleapis.com/auth/calendar
Now I am able to read all the events and subscribe to the web_hook. My doubt is twofold -
For the same user, when I fetch the calendar list using CalendarList.list method (Calendar A), it is different from the list I get when I hit calendar list API from the admin directory side (Calendar B).
Is it because there are 2 sets of calendars being maintained for the user side and one from the admin side (that is domain wide)? If so, how can I modify or create an event in calendar B? (it is pretty simple from the UI side, I open my calendar and add that particular room to the meeting).
If there is a meeting (event) planned and I need to release the meeting room (i.e. the calendar itself because the rooms are coming as calendar resources themselves) from the meeting, which API should I hit?
Actually I need to simulate real life scenario where I have a meeting scheduled in a meeting room but then I want to keep the meeting but not the room, so that the room is no longer occupied and others might use it. It is during implementation of this flow that I had above 2 doubts.
Please help me out here as I am completely new to programming and it has been days since I started banging my head over it.

To answer your concerns, please see below:
Yes, that is correct. The calendars mentioned(user and admin) are completely different calendars. As for modification in calendar B, as long as you have the calendarId, you can use Events: insert .
The room should appear in the event resources and you can update it via Events: update.

Related

How do you get a URL to a shared O365 calendar?

I have been playing around with the Graph API to access the shared calendars and events within an organization.
I can successfully query my organization users and the calendar/events for any of those users. What I would like to do now is to generate a URL allowing you to jump to an outlook web session (eg - https://outlook.office365.com/calendar/) directly to a particular user's calendar (that you have access to).
I can see that Events have a 'WebLink' property that allows you to do this with a calendar event, but I can't find any documentation that indicates how you could jump to a calendar the same way.
I did find some old stuff implying that the old school OWA used to allow this but those url's don't look like they work anymore.
I also tried to pull apart the URL's provided when you 'share' you calendar with an external email address and it sends them a 'click here to add the calendar, or here to see a web view' etc email. That looked kind of promising because it actually DOES provide a direct link to a web version of the calendar; but it it includes a few fields in the URLthat I can't figure out (more than likely the external user auth) so I can't reverse engineer it to build one with the info I have available in the Graph API.
URL was of the form:
https://outlook.office365.com/owa/calendar/<userid>#<domain>/<52CharacterHex_ProbablyAHashedTokenForTheExternalUsersAuth>/<WindowsUserSID_ProbablyToRepresentTheExternalUserOrProxyAccessEntity>/reachcalendar.html
Anyone else got any ideas on how I can launch a web session of another uses calendar (that I have access to)? Ultimately what I am doing is creating a small management dashboard (using a summary built via Graph API data) that shows an overview of a collection of user's calendars but allows you to jump into the any individual user's full calendar if more info is required.
Publish to the web. follow this:
https://support.microsoft.com/en-us/office/share-your-calendar-in-outlook-on-the-web-7ecef8ae-139c-40d9-bae2-a23977ee58d5
basically
OWA -> Settings
Calendar -> Shared Calendars
Publish a Calendar -> copy HTML

Google Calendar API: error «Calendar usage limits exceeded»

Problems
As part of my task to provide the ability to manage events via the Google Calendar API. Events use two groups of guests (attendees):
- Group 1 is Google accounts with alternative mail from the same domain (for example site.com)
- Group 2 is person with email all around the world.
This may be a conference call with the participation of 3-10 people, and the annual meeting of about 100 guests. On all events there can be representatives from both groups.
But I am faced with a restriction on the use of the API, which does not allow us to accomplish this task. I managed to find out the cause of this error and reduce the data to analyze the problem to a minimum.
Workflow and mechanism
Group 1: Each Google Calendar user is a separate personal Google account with setting “Alternative emails” from the same domain. They have an additional shared calendar for these events, with email notification enabled.
Group 2: This is person with email all around the world, that may have an Google Calendar Account or do not, which are used as the Guest ID for the event.
The organizer (group 1) has an authorized valid access token. He creates an event with a the list of guests. As the guest ID is used Calendar_ID account.
At first, the event was successfully saved correctly and the notification was received for external participants successfully, without errors. But after several repetitions of creating events similar in parameters, an error began to occur. I get the Calendar usage limits exceeded error:
{"error": {"errors": [{"domain": "usageLimits", "reason": "quotaExceeded", "message": "Calendar usage limits exceeded."}], "code": 403, "message ":" Calendar usage limits exceeded. "}}
Although if you save the event only for yourself in own calendar_id without any participants, the following error does not occur!
I have processed enough materials and similar problems from sites:
- https://developers.google.com/calendar/support
- https://stackoverflow.com/questions/tagged/google-calendar-api
- https://productforums.google.com/forum/#!forum/calendar
There are several pages indicating a similar problem, but there are no specific solutions or workarounds.
And I see only one real reason for the appearance of such a restriction:
https://support.google.com/a/answer/2905486?hl=en
"Sending too many invitations or emails to external guests". Perhaps I have reached this limit of 100-300. But what to do with it?
Additional investigation
For the tests I have created a completely new test environment:
1. A separate Google user has been created as an organizer, with his own calendar and additional calendar.
2. Created a separate Google user as a guest for the event, with your calendar and additional calendar
3. All creation of events was used via web calendar.google.com interface.
As result:
- An additional attendee's calendar has reached the limit after creating the 4th event, within 5 minutes
- The main calendar - after creating the 15th event, within 15 minutes
I got a restriction that I should try to create an event later. Perhaps there is some kind of limiter on the frequency of creating/updating an event, but nowhere is this mantioned.
With a break of 4 hours, I was able to create only 5 events for the main calendar, I could not add an additional event to the additional calendar due to an error.
Questions
1. How do I get around these calendar blocking restrictions? In addition, all guests receive this event as desired and are clearly ready to confirm receipt of such events (subscribe to events from certain organizers).
Is it possible to perform this task using G Suite solution or another similar?
Could you please provide me with some an extended documentation on the API of the Calendar about:
conditions for calendar limitation exceeded (I have not found these criterias for using the API of the Calendar on the official website and pages of official forums)
time to unlock to save/update the event, after the occurrence of "Calendar usage limits"
Thanks in advance for your rapid reply as soon as possible.
Based from this support page:,
Calendar usage limits exceeded. This is the result of an API call. (Don't mix this up with the message "Daily quota exceeded," which points to insufficient API quota.)
It also means that the user reached one of the Google Calendar limits in place to protect Google users and infrastructure from abusive behavior. (Reference.)
Suggested actions:
Read more on the Calendar usage limits in the G Suite Administrator help.
If one user is making a lot of requests on behalf of many users of a G Suite domain, consider using a Service Account with authority delegation (setting the quotaUser parameter).
Use exponential backoff.

Signing into Hangouts as Resource and/or mirroring user & resource calendar?

I'm working on a Proof of Concept. I would like to have be the homepage be g.co/hangouts in a conference room where it shows all the meeting in that room.
I think to do this I would either have to sign into google with the resource's account info OR have a user account named "UserRoom1" and whenever someone, using their own account schedules the resource "Room1," "UserRoom1" is invited to that meeting.
any way this can be accomplished? I want to make this as invisible/user-proof as possible so asking users to remember to simply invite "UserRoom1" to all of the meetings in "Room1" is significantly less ideal.
I wanted to do the exact same thing, and I think it is only possible if you buy one of Google's Chromebox for Meetings products, which costs a minimum $1K, and then requires a $250/yr subscription after the first year. This page shows how to associate a Chromebox for Meetings with a calendar, which seems to be the functionality we are missing. Ultimately I think you have to do the "User as Resource" setup, so "UserRoom1" shows up in the list as a user (rather than a resource). Slightly janky but it mostly gets the job done.
We also have a few common hangouts that I have bookmarks set up for on the conference room computer's Chrome bookmarks bar, so we're not totally bound to the meeting invite hangouts.

Sharing Google Calendar's in an Organization

Question:
Is there a simple way to automatically share a calendar with users in a Google Organization.
Current Technology:
I am looking in to streamlining our calendars within our organization. We are using a Google business account for our calendars, emails, contacts, and we sync it all on to our Mac's.
Current Method:
When we add a new calendar for each office location, (1) we have to create calendar on the super admin account, (2) share it with everyone, (3) each user must accept the calendar, (4) then we use google Sync Select to add the calendar to their list, and (5) finally we sync it with iCal.
Issues with Current Method:
- Too many steps for a large group of users
- Cluttered calendars (since we all share a calendar based off office location)
- Difficult to assign specific events
Thanks in advance. Let me know if you need any more information!
Steps 1-3 can be done automatically through Google Calendar APIv3. You can create a service account, delegate the domain authority to it and then use it to create the new calendars and share them. Take a look into authority delegation here: https://developers.google.com/accounts/docs/OAuth2ServiceAccount#delegatingauthority
The documentation for API v3 is here:
https://developers.google.com/google-apps/calendar/

Mixpanel - Is there a way to distinguish first time visitors from others?

We have Mixpanel currently setup in our website, and we are following the recommendation around using alias (when signing up) and identify (when users logs in).
One thing I can't get my head around is if it's possible with Mixpanel to see the behaviour users (logged in or not) have on theirs first visit to the website.
Since Mixpanel uses a cookie, I supposed I could manually check that, but just wondering if there is something already built for it.
You need to do this manually, there are no solutions for that task.
Mixpanel was not created for tracking visits, new unique users are tracked in Google Analytics.
Mixpanel places a timestamp for every event you track.
So, when you watch Retention it generally knows when the first ever event for each user occured.
If you want to analyze first visits in Mixpanel Funnels (not Retention) create event called "First Visit" and fire it using this scenario (you need to write additional code to your website of course):
On each user visit to your website ask mixpanel cookie if it already has UserID, not just an AnonymousID (watch Resources-Cookies in Google Chrome developers mode for parameters))
If it doesn't - fire IDENTIFY method (with anonymousID) and then your "First Visit" event.
If it does - do nothing.
Then, when user SignsUp - fire ALIAS method to merge previously identified anonymous visit with the newly identified registered user so that "First Visit" event will be tied to the registered UserID.
Note! This scenrio is suitable only if you use your own database userIDs and only if user visits your website from one device. (Unfortunately if user first came from PC and then registered from Tablet - the First Visit event tied in his profile will be from Tablet, not from PC. This is how cookie works)

Resources