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

141 Views Asked by At

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?

0

There are 0 best solutions below