Google Calendar push notifications are sent to all participants when one participant responds to an event - google-api

When using Google Calendar API push notification, suppose, sender A sends a meeting invite to B and C. When B accepts the meeting invite, C also receives a push notification.
This can be problematic in cases where a meeting invite is sent to a lerge number of recipients, say 200 people. In this case each of the 200 recipients of the invite will also see 200 push notifications only due to other recipients accepting or declining the event.
Is there a way to get push notifications only in case an event's start or end time is changed or event is deleted but not receive push notifications when recipients accept/decline an event?
With Office365 API, I do not see push notifications being sent in this scenario.

The Google Calendar API provides push notifications that let you watch for changes to resources.
A resource is changed if anything if it is updated or deleted and in this case if a user accepts or declines.
Answer: No you cant pick You get all the changes you do not get to pick which changes you want. You get notified of all changes on a resource. I suggest that you filter out the changes that you dont want locally.

Related

Gmail API push notification duplicate message ids

I am using Gmail push notifications for email processing. When I receive a message notification from Google, I use the history list API with the previously stored historyId and can see new messages using messagesAdded. Once I have retrieved the messages, I store the last historyId for the next request.
When testing, if I send two mail messages (about 30 seconds apart) to the watched mailbox, I see two messages notifications from Google and when I call the history API for each of the notifications I see the message ids. This is all good.
If I repeat the same test but send the two mail messages immediately after each other, I get the two notifications from Google but when I call the history API for the first message, I get the two message ids in that history API call. When I call the history API call for the second notification, I get a duplicate of the last message id.
How can I prevent seeing duplicate message ids in this scenario? Any help or pointers would be much appreciated.
Updated: Added request and response example for second test.
I noticed in the response from the Google History API a historyId showing the latest messages that have been processed. If I store this value as the next start point instead of the historyId sent in the notification message, it works around the duplicate issue as on the second request there are no more messages. Not sure if this is the right way to do this as it means I don't store or use the historyId sent in the notification message.

Calendar Event sendNotifications inconsistency when attendee is a secondary calendar

I am creating and updating events using a service account and there appears to be an inconsistency between how notifications are handled depending on whether the attendee email is a primary or secondary calendar.
In the following example all calendars are set to receive invite and event change notifications by email.
Joe Smith has a primary calendar j.smith#gmail.com
Sam Stove has a secondary calendar xxx#group.calendar.google.com
Event inserted with Joe and Sam as attendee's (sendNotifications => false).
Joe does not receive a notification (as intended), Sam does. To reiterate Joe and Sam have identical notification settings on their calendars. With sendNotifications => true both receive a notification (as expected).
I am using the PHP API client 2.1 but I tried with 1.x as well and the outcome is the same. Since sendNotifications is a simple GET parameter I tend to think this is an API issue rather than a client issue.
As mentioned in Notifications,
To send email notifications to attendees for events that were inserted or updated via the API, set the sendNotifications parameter in the insert/update request to true.
And, do also note that:
For attendees with non-Google email addresses, these notification emails are the only way they can find out about the event: it won't be added to their calendars automatically.
This additional references might also help:
Registering your domain
Verifying domains for push notifications

Outlook REST API Push Notification always send the same ResourceData

I subscribed to Outlook Push Notification Services, precisely I want to receive push notifications for sentitems.
Consequently, I use https://outlook.office.com/api/v2.0/me/MailFolders/sentitems/messages as Resource in my #Microsoft.OutlookServices.PushSubscription POST request to the url https://outlook.office.com/api/v2.0/me/subscription
As expected, I receive the push notification when I send an email. The problem lies in the fact that the ResourceData is always the same. The Id never changes and correspond to the one I received after the first Notification.
I also remarked that even when no mail is sent I keep receiving notification with "ChangeType":"Created" (and always the same ResourceData.Id).
This may be a bug, or should I send back something to the subscriptions after receiving a notification?
This is because the webhook responded to the push notification request with status code 500. Hence Outlook Push Notification Services treated this request as failed and then retried it later for several times. As the notifications of the same subscription are processed in sequence, later notification won't be sent until the earlier notification was successfully sent out. That's why you saw multiple notifications with the same resource data and change type even when no change happened.

Get notified about changes in a google calendar

I was wondering, is it possible to set up a Mac OS X app, to get notified when a user makes changes to a Google Calendar. Like what you can do with EKEventStore?
There’s a query method + (id)queryForCalendarListWatchWithObject:(GTLCalendarChannel *) object, but I’m not really sure how you should set up the GTLCalendarChannel object.
Or is the only way, other than polling, to use push notifications?
Thanks in advance.
You can use Google Calendar API which provides push notifications that let you watch for changes to resources. This makes periodic polling unnecessary.
You can use this feature to improve the performance of your application. It allows you to eliminate the extra network and compute costs involved with polling resources to determine if they have changed. Whenever a watched resource changes, the Google Calendar API notifies your application.
To use this API, you need to:
Register the domain of your receiving URL. Before you can set up a push notification channel, you must register the domain for any URLs you plan to use to receive push notification messages.
Set up your receiving URL, or "Webhook" callback receiver. Whenever a watched resource changes, your application will receive a notification message describing the change. The Google Calendar API sends these messages as HTTPS POST requests to the URL you specified as the "address" for this notification channel.
Set up a notification channel for each resource endpoint you want to watch. To request push notifications, you need to set up a notification channel for each resource you want to watch. After your notification channels are set up, the Google Calendar API will inform your application when any watched resource changes.
When a calendar changes, it will notify your app and the app does an API call to get the update. You can use one of the Google API client libraries to utilize push notifications.
Check these documentation and blog about Google Calendar API Push notifications.
Hope this helps!

Add Notificatoin Through REST API

In my application, I need to be able to add custom notifications to Yammer. Is there an undocumented way to add a notification through the Yammer Notifications REST API?
Notifications are sent when specific actions in Yammer are triggered, like when a message is received for a user a push notification will be sent to that user. There is no ability to manually generate push notifications for arbitrary events.

Resources