Using Apps Script to create Calendar Appointment Slots

不想你离开。 提交于 2020-01-10 03:15:09

问题


I am using Google Apps Script to create calendar events but want to also create Appointment Slots. Apps Scrip appears not yet to support Appointment Slots (or am I missing something?). If not, does anyone know if this is this likely to be added shortly?


回答1:


This is still not possible. I created an empty calendar, and called the event listing API here. I got an empty calendar. Then, I added a single appointment slot, and called the same API. I got the same empty calendar. Then, to make sure I wasn't high on crack, I created a test event, and called the same API. I saw my test event.

Therefore, it is my conclusion that Google Calendar Appointment slots are still half-baked, and not acceptable for integration in third party applications without some MAJOR hackery / web scraping.

Here's a listing of my results with one/no appointment slots:

{
 "kind": "calendar#events",
 "etag": "\"p32k9df48mm1dk0g\"",
 "summary": "API Testing",
 "description": "Testing Calendar API",
 "updated": "2018-03-23T12:10:57.161Z",
 "timeZone": "Europe/Moscow",
 "defaultReminders": [],
 "nextSyncToken": "CKiWvIi1gtoCEKiWvIi1gtoCGAY=",
 "items": []
}

and here are the results of one event:

{
 "kind": "calendar#events",
 "etag": "\"p33kdnpkimq1dk0g\"",
 "summary": "API Testing",
 "description": "Testing Calendar API",
 "updated": "2018-03-23T12:15:47.265Z",
 "timeZone": "Europe/Moscow",
 "defaultReminders": [],
 "nextSyncToken": "COjb5pK2gtoCEOjb5pK2gtoCGAY=",
 "items": [
  {
   "kind": "calendar#event",
   "etag": "\"3043614692092000\"",
   "id": "5q94fuj2ufmgq29tmg4fibn8sr",
   "status": "confirmed",
   "htmlLink": "https://www.google.com/calendar/event?eid=NXE5NGZ1ajJ1Zm1ncTI5dG1nNGZpYm44c3Igbm92ZW50dW0udXNfZGpvdmRrdTdjNzNzbDFjZjl2ajFtaHQyYzBAZw",
   "created": "2018-03-23T12:15:46.000Z",
   "updated": "2018-03-23T12:15:46.046Z",
   "summary": "Appointment",
   "creator": {
    "email": "brian@pleasenospam.com"
   },
   "organizer": {
    "email": "noventum.us_djovdku7c73sl1cf9vj1mht2c0@group.calendar.google.com",
    "displayName": "API Testing",
    "self": true
   },
   "start": {
    "dateTime": "2018-03-23T16:30:00+03:00"
   },
   "end": {
    "dateTime": "2018-03-23T17:30:00+03:00"
   },
   "iCalUID": "5q94fuj2ufmgq29tmg4fibn8sr@google.com",
   "sequence": 0,
   "reminders": {
    "useDefault": true
   }
  }
 ]
}

This is how I recommend testing this functionality every six months or so if you're planning on integrating with this.

This is unfortunate. My customer has a web form on his website for scheduling events. He wanted me to integrate with his Google calendar, which would have been super cool for appointment scheduling. Unfortunately, this is not possible in the way we envisioned (get listing of appointment slots on his website, show those as available times, and then book them when a user selects one / submits the form.)

What I will propose instead is assuming what the appointment slots are, hardcoded, from the application. This has obvious drawbacks, and is not as cool for managing appointment slots. He could also have a "special" event that I scan for, and then use those as appointment slots (i.e. hack appointment slots into the API by a mutually respected magical word.)

With all the resources of Google, wouldn't this be cool to implement...? You know you want to.




回答2:


It does not support them and it is unlikely to do so in the near future, although in the long term we will probably add support for newer Calendar features eventually.



来源:https://stackoverflow.com/questions/12724958/using-apps-script-to-create-calendar-appointment-slots

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!