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

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?

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.

Google Places API Difference between _id and place_id

Could someone please explain me the key difference between the attributes: _id and place_id?
I know: Place IDs uniquely identify a place in the Google Places database and on Google Maps.
But what does the attribute _key representing ?
Example Response Code from the Google Api:
{
"_id": "d5bcd8db4a52088350ffb502c31c6694918d3907",
"place_id": "ChIJb3D1a2mnkUcRxop5hdAGiwY",
"lat": 27.991789,
"lng": 3.865653,
"name": "We Are here",
"rating": 0,
"user_ratings_total": 0,
"types": [
"school",
"point_of_interest",
"establishment"
],
I believe the _id field was deprecated and should disappear from responses shortly.
The Places fields reference, id, alt_id, and scope are deprecated as of September 3, 2019, and will be turned off on June 3, 2020.
The id and reference request parameters have been replaced by the place_id request parameter.
the alt_id and scope fields have no equivalent, as they were only used for the Place Add service which was turned off in July 2018.
source: https://developers.google.com/maps/deprecations#places_fields_reference_id_alt_id_scope_-
I guess Google just renamed deprecated id field as _id.

create calendar on office 365 outlook

I am an administrator of Microsoft office 365 in a mid-sized company.
All employees want to see all other's schedules. They, of course, know they can add other's calendar on their own outlook and see schedule, though They want to see see all other's schedules. It is somehow cumbersome for them to add all employees on their own outlook. They want admin to manage calendar group on outlook in company-wide.
I did not find any powershell cmdlet to manage calendar group, but found graph API Create Calendar https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_post_calendars.
For example, if I were A#example.com and wanted to see B's calendar. When I run create calendar API on graph explorer with owner:{"address":"b#example.com", "name":"B"} and it ends with success and shows result that owner:{"address":"a#example.com", "name":"A"}. Of course I cannot see B's schedule on my outlook.
this is post request body:
{
"name": "b",
"color": "auto",
"owner": {"address":"b#example.com", "name":"b"}
}
This is result:
{
"#odata.context": ....
"name": "b",
"color": "auto",
"changeKey": "......",
"canShare": true,
"canViewPrivateItems": true,
"canEdit": true,
"owner": {
"name": "a",
"address": "a#example.com"
}
}
How can I satisfy my employees' request?
Thank you,

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.

Google Calendar Events Response is Empty

We are fetching google calendar events through OAuth2 tokens with Google Calendar API V3 to our customers, but for some of customers' calendar getting empty response. We got empty response for the same calendar in Google OAuth Playground.
{
"nextPageToken": "CjkKK2xwamMycHJ2MDU2cGp2YFxcmY3OXRtNTg0XzIwMTQwMjEyVDA0MzAwMFoYASCAgMDEtcaFoBQaDQgAEgAY2M-X7qfLvAI=",
"kind": "calendar#events",
"defaultReminders": [
{
"minutes": 30,
"method": "popup"
}
],
"items": [],
"updated": "2014-02-14T09:32:57.943Z",
"summary": "TEST",
"etag": "\"TuPKiPtcUnaxp3U8BefUMu26Bg/LWnnxrAP6L1-mgjBDhy0rIebYaE\"",
"timeZone": "Asia/Calcutta",
"accessRole": "owner"
}
But when the same user is authenticated through AuthSub, it is fetching the events list. Is anyone having the same issue? Any help would be appreciated.
TIA,
Riyaz.A
Have you tried actually calling the API with the nextPageToken? Usually the client libraries do this auto pagination for you, but in this case you may need to manually make the call. In general, you should plan on calling next pages until nextPageToken is empty or not present.
This might just be an weirdness with the API.
We can't set pageToken to the event instance
Calendar.Events.List events = service.build().events().list(gCalId);
But when we try model Events instance, we able to set pageToken and got response too
com.google.api.services.calendar.model.Events events = service.build().events().list(gCalId).setPageToken(pageToken).execute();

Resources