Google busyFree endpoint, unexpected behaviour - google-api

I submit a POST request to the https://www.googleapis.com/calendar/v3/freeBusy endpoint with the following data:
{
"timeMin": "2017-02-23T08:00:00Z",
"timeMax": "2017-02-23T09:00:00Z",
"items": [
{
"id": "XXX#gmail.com"
}
]
}
The calendar is containing an event at the specified date from 8:00AM to 9:00AM. The API returns the following:
{
"kind": "calendar#freeBusy",
"timeMin": "2017-02-23T08:00:00.000Z",
"timeMax": "2017-02-23T09:00:00.000Z",
"calendars": {
"XXX#gmail.com": {
"busy": []
}
}
}
That does not appear to be correct, as the specified timeMin and timeMax do exactly match the calendar item.
If I set the calendar item to 8:01AM - 9:00 or 8:00AM to 9:01 it returns the expected results (the calendar item). There is no detailed explanation on those time parameters, but it looks like that they have to be inbetween the actual calendar item?

Based from this thread, it's okay if you set to 8:01AM - 9:00 or 8:00AM to 9:01.
From the example in the above link, timeMax is set to 2012-10-25T23:59:59Z. It was stated that "Since timeMax is exclusive in your example if you happen to have a calendar event on the 25th at 11:59:59pm you wouldn't retrieve it (rare, I know, but still possible)."
However, you can file a report if you think this is a bug.
Hope this helps!

Related

How can I disable waiting room in Google Meets created with calendar api?

In the Google Calendar api there's the ability to request that a conferencing link be created when an event is created.
My current setup is that I have an account that is creating google calendar events whenever someone schedules a meeting on my app. The problem is that when someone outside of my organization tries to join the meeting it says "ask to join" which isn't possible since nobody from my organization will be in the meeing. Are there are parameters to let me turn off the waiting room feature or at least have a list of approved emails that are allowed to enter the meeting. The request body looks like this right now:
{
"end": {
"dateTime": "2020-08-30T05:27:35.206Z"
},
"start": {
"dateTime": "2020-08-29T05:27:35.206Z"
},
"conferenceData": {
"createRequest": {
"conferenceSolutionKey": {
"type": "hangoutsMeet"
},
"requestId": "12345"
}
},
"summary": "Test event with meets 2",
"attendees": [
{
"email": "****#gmail.com"
}
]
}
The attendee I added still has to request to join the meeting.
This appears to be a bug!
I have taken the liberty of reporting this on Google's Issue Tracker for you, detailing the behaviour:
User from outside of G Suite domain required to ask to join a Meeting from a Calendar event they are invited to
You can hit the ☆ next to the issue number in the top left on the page which lets Google know more people are encountering this and so it is more likely to be seen to faster.

Getting excluded dates from recurrent events through Microsoft Outlook Calendar API

I am creating an event with recurrence in Outlook Calendar and want to retrieve its full specification through API.
For example, the event repeats every weekend for a year.
However, I removed some of the weekends from the time line, creating an exception to a recurrence rule.
How can I get these excluded dates through the API? When I receive a response with events from Outlook Calendar API I can not find an entry with excluded days.
Response with recurrence from Outlook Calendar API:
"recurrence": {
"pattern": {
"type": "weekly",
"interval": 1,
"month": 0,
"dayOfMonth": 0,
"daysOfWeek": [
"saturday",
"sunday"
],
"firstDayOfWeek": "monday",
"index": "first"
},
"range": {
"type": "endDate",
"startDate": "2017-08-19",
"endDate": "2018-01-30",
"recurrenceTimeZone": "FLE Standard Time",
"numberOfOccurrences": 0
}
},
On the event object, there's a type property that has values including SingleInstance, Occurrence, Exception and SeriesMaster.
If you have the event ID of the series, you should be able to query exceptions like this:
https://graph.microsoft.com/v1.0/me/events/[series id]/instances?startdatetime=2017-08-14T16:35:08.284Z&enddatetime=2017-08-18T16:35:08.284Z&$filter=type eq 'Exception'
According to the docs for listing event instances, this returns "occurrences and exceptions of the event in the specified time range".
Update: This might not actually work. I'm testing this now and the call returns a 200 status code, but an empty array of event exceptions. I'll investigate and update this when I learn more.

How do I create an all day event in the Google Classroom API Method: courses.courseWork.create?

I would like to add an all-day event to my Google Classroom Course as an assignment with the Classroom API found here: Method: courses.courseWork.create documentation
Here is the json request I've been using in their API explorer:
{
"title": "Lesson 1.1",
"workType": "assignment",
"state": "published",
"description": "This is a test assignment.",
"dueDate": {
"year": 2017,
"month": 9,
"day": 2
},
"dueTime": {
"hours": null,
"minutes": null
}
}
I've tried many variations, but it always posts the assignment due at 8:00 PM by default, never an allDay or all-day event. Removing the dueTime isn't allowed per the documentation. Yet, when I manually create a lesson it's an optional field. I inspected the post data and couldn't find out how this is happening.
It doesn't appear to mention how to create an all-day event in the Google Classroom API documentation and the Google Calendar API docs didn't give me any usable hints.
Any ideas?

Google calendar API - check for conflicts

I'm making a little app which manages appointments - I need to know if there's a currently supported way to check if an event overlaps within a google calendar.
Basically I read a list of events from my app's created calendar, and then populate my application using that.
Then, I add a calendar event. I need to check if it conflicts with what already exists. Is there a way to do this with their api?
The Google calendar api has a method called freebusy it basicly returns a list of events between a two times if they exist within a calendar.
Request events between may 20th and may 25th on my primary calendar.
{
"timeMax": "2017-05-25T13:44:16.549Z",
"timeMin": "2017-05-20T13:44:16.549Z",
"items": [
{
"id": "primary"
}
]
}
results
{
"kind": "calendar#freeBusy",
"timeMin": "2017-05-20T13:44:16.000Z",
"timeMax": "2017-05-25T13:44:16.000Z",
"calendars": {
"primary": {
"busy": [
{
"start": "2017-05-23T15:35:00Z",
"end": "2017-05-23T16:35:00Z"
},
{
"start": "2017-05-24T13:00:00Z",
"end": "2017-05-24T13:30:00Z"
}
]
}
}
}

Add online meeting url to event with Microsoft Graph API

Could anybody help me with creating an event with Microsoft Graph API.
Desirable behavior is to add a link to the event which is clickable in majority of the calendar clients.
Here is an example of the event payload I’ve used:
{
...
"body": {
"ContentType": "HTML",
"Content": "Start Online Meeting"
},
"onlineMeetingUrl": "https://somelink.com"
}
This payload is sent as POST request to https://graph.microsoft.com/v1.0/me/events
current response is:
{
...
'onlineMeetingUrl': null,
...
}
and details of the event are not clickable in the calendar app
and displayed like plain text
Start Online Meeting
or is converted to
Start Online Meeting <https://somelink.com>
in Google calendar
Thanks for help!
Can you try escaping double quotes character in value of Content property and wrap the anchor tag in div element? Example below:
{
"body": {
"ContentType": "HTML",
"Content": "<div>bing</div>"
}
}

Resources