Office 365 API Not All Events Being Received - outlook

I am using the Outlook Calendar REST API to retrieve calendar events.
When I call the url https://outlook.office365.com/api/v2.0/users/#{email}/calendarview?endDateTime=2016-09-01T10:00&startDateTime=2016-08-10T10:00
I get only the single event instances returned. How can I include the occurrences of repeating events too?

The calendar view REST gets the occurrences, exceptions, and single instances of events in a calendar view defined by a time range. It works well for me. Please check whether the time range is correct to filter the view.
In addition, you can check the type of event type in the response. It should be Occurrence in this scenario.
Update: test with Microsoft Account

Related

Is there a way to retrieve G Suite resources usage information per user?

In our organizational G Suite service, we defined rooms in "Building and Resources".
We schedule meetings in these rooms through Google Calendar.
Is it possible to get an organized report, that shows room usage per user? We would like to know which user used which room and for how many hours per time unit (month). Is there a way to get this information? An organized report? Any form of raw data?
We could only find general high-level data about the usage of each room, but no specific user data.
Issue:
There's no built-in method to retrieve this information.
If you think this feature could be useful, I'd suggest you to file a feature request on this Issue Tracker component.
Workaround:
Even though there's currently no direct method to retrieve an organized report for this, you could retrieve the information about how much a resource is being used by the different users, using Calendar API.
You could do the following:
A Calendar is created for each resource. This Calendar contains all events in which the resource is present (a resource can be added as an attendee for the event, or the event can be directly created on the resource calendar; either way, all events will be present in the resource calendar). Find the corresponding calendar ID by clicking Settings and sharing for the calendar, and scrolling to the section Integrate calendar.
Call Events: list, setting the calendarId property to the ID you retrieved in previous step. This will return all events in which this resource has been used. You could also retrieve the events between a specific time interval, by specifying the properties timeMin and timeMax.
Each event in this retrieved list will have information about: (1) the event attendees, including its organizer (check the attendees property on the Events resource), and (2) the event start and end time (check the properties start and end). With this information, you can know which users used each resource and for how much time. You'd just need to filter the events according to the attendees, and calculate the event durations using the start and end dates.
Repeat steps 1 to 3 for each resource.
Update:
Feature request reported on Issue Tracker:
Report resources usage information per user

Mailchimp api: retrieving poll results

Is there a way to get the members to a certain response of poll without the need to create segments?
I am sending mails and have a poll included (basically participating at an event).
Now I would like to easily collect the respondents for an event from various mails (announcement, invitation, reminder 1, reminder 2,..)
Currently I need to create segments for each response where I need to reference the campaigns individually. So whenever I send a campaign (email) I need to update all segments as there need to be a segment per question, which I would like to avaoid.
Hope thats clear enough.
I had a similar question and after a review of the mailchimp API docs, in particular the reports section I realized there was not a way to retrieve poll results.
After my review, I followed-up with mailchimp and they mentioned access to poll results via API is not available - detailed comments with image attached below:
MailChimp Response - Start
"To be completely honest and transparent, there currently wouldn't be a way of accessing the campaign poll result data directly through the report... With that being said, it would be possible to use the API to create segments based on poll response, then call those segments to view the number of responses for each option, as well as the specific subscribers who chose each individual option.
More info here: https://developer.mailchimp.com/documentation/mailchimp/reference/lists/segments/
MailChimp Response - End
As you can see, although accessing poll results via the API is not available, there is a work around using a method.
Good luck!

Google Calendar Watch and Events working together

I am creating a Node/Express Webapp that would mirror a user's calendar. It would get a notification for every change in the users calendar, and would update the DB with the latest of that user's calendar.
Lets assume that we want to monitor john.doe#gmail.com. Kindly tell me if this is the best (and only) way to do it:
Set up for Push notification - While doing so, we provide (amongst other fields):
token - A plain-text that would be echoed back. This is where I can put something like 'calOwner=john.doe#gmail.com'
id - A UUID channel id
Upon every change, my webhook will get a push notification that would contain:
token : calOwner=john.doe#gmail.com
id : the channelId - I dont understand if this field alone can be used to trace this notification message back to john.doe#gmail.com
Now that I know john.doe#gmail.com has changed, I would do a list with a synchToken. This will return me the change in john's calendar since last synch
What baffles me here is that the seemingly important fields channelId and resourceId (which appears as x-goog-resource-id in the push notification header) are useless, and the only field that ties the push message to list is an optional plain-text field token .
Kindly tell me if this is the only way to track a user's calendar.
UPDATE
Thanks #KENdi for the answer.
My struggle was with the point that simply looking at a push notification message, there is no way to trace it back to john.doe#gmail.com . I now understand why such is the case, that a push notification does not contain the calendarId, but the resourceId instead (which, in plain terms is the event object). It is so because an event can be associated with multiple calendars, and hence multiple calendarIds. Hence, it is the subscriber's responsibility to maintain association of the channel to the calendarId that he had used to create the channel at the first place.
Yes, you are correct, you need the calendar push notification, to notify you about all the changes happened in the Google Calendar.
The purpose of X-Goog-Resource-ID is an opaque value that identifies the watched resource. And this ID is stable across API versions.
Check this SO question to know more about the purpose of X-Goog-Resource-Id.

Efficient way of syncing Gmail Inbox messages using the new Gmail API?

A web application sends an email on behalf of a UserA to UserB, using the new Gmail API (Users.messages: send).
The synchronous response contains threadId, messageId which are stored in the database.
We then query the history API for any changes in user's inbox (Users.history: list).
Is there an efficient way to get all the updates since last sync (new replies, read/unread changes)?
One implementation that we tried was to filter the history API results through a custom label. Unfortunately, we noticed that once a thread/message is tagged with a specific label any subsequent responses are not labeled automatically and new replies are not included in the history API response.
A second approach was to query threads using gmail advanced search for a particular label and date (e.g. after:2014/08/29 label:MY_LABEL). The problem was that gmail does not return threads that were created before 2014/08/29 but had a reply on that date.
Any scalable suggestions would be greatly appreciated.
Not sure I understand here, users.history.list was made exactly for this. Given a previous historyId, you can then call history.list(previousHistoryid), iterate through the results to find all the message Ids that have been updated since the previous historyId. Then call messages.get() on all of those--for any messages you already knew about you can just call format=MINIMAL (to see label updates), and for new messages you can use a different format to get the message content if you need it.

Why am I not receiving an EXDATE for a recurring event that has one of its instances removed or modified?

Using the Google Calendar API, and for a weekly recurring event on every Friday that never ends, I have cancelled one of the instances and modified the starting time for another instance several weeks later. On fetching this event from the calendar, it does not contain any EXDATE as specified on http://www.ietf.org/rfc/rfc2445, referenced by https://developers.google.com/google-apps/calendar/concepts
Why not? How does Google handle the modification of instances within a recurring rule? In fact, I only ever see RRULE in the recurrence field of the response. When do the other types of recurrence types appear such as EXDATE, EXRULE, RDATE, etc..?
You will get an instance of a recurring event with status=CANCELLED instead of an EXDATE if you cancel the instance through the Calendar API. EXDATEs however are an alternative that results in the same effect of the event being deleted.
EXRULEs are now deprecated as per RFC 5545 (https://www.rfc-editor.org/rfc/rfc5545), RDATEs should work.

Resources