1

I have a restaurant reservation website build with Laravel and running for merchant and customer.

What I would like to do is, when customer successfully booked at merchant's restaurant, I would like to sync reservation data to "merchant's google calendar" as well as "customer's google calendar".

Is it possible to do with Google Calendar? If so what's the approach to do that?

What would be the seamless approach to sync data between their own calendar and my calendar (from my website)?

Zombo
  • 1
  • 62
  • 391
  • 407
knightrider
  • 2,533
  • 7
  • 30
  • 42
  • In principle, syncronizing calendars is described [in the docs](https://developers.google.com/google-apps/calendar/v3/sync); however, I'm not sure what exactly you are trying to do. Do you really need a full calendar sync, or do you just want to insert an event into two different calendars? – P_S Sep 08 '15 at 05:10
  • @P_S , what I want to do is, at first time, if user never done syncing with Google Calendar yet, I want them to perform Full Calendar Sync. Then subsequently, whenever there's an event happening on my website, I want to sync those event to their google calendar too. – knightrider Sep 08 '15 at 06:24
  • So you want me to let you download all of my person calendar appointments into your restaurant's calendar? As well as sync your restaurant appointments into my calendar? 1. there is no way I would ever want a restaurant to see my personal appointments . 2. I could care less what appointments your restaurant has. Why do you think this is a good idea? – Linda Lawton - DaImTo Sep 08 '15 at 06:52
  • Ah nope @DaImTo, it's only sync my data to their Google Calendar. Not their data to my calendar (my database). – knightrider Sep 08 '15 at 07:07
  • I still don't want all your restaurant appointments in my Google Calendar. By granting you access to write to my google calendar I am also giving you access to read from it so you "could" take my appointments and do what you will. Why do you think this is a good idea? – Linda Lawton - DaImTo Sep 08 '15 at 07:09
  • why not just offer to share your calendar with your users then they can decide if they want to see them and the restaurant appointments are all kept in a single calendar and not mixed into my personal calendar? – Linda Lawton - DaImTo Sep 08 '15 at 07:10
  • @DaImTo, what I want to do is, for those users who want to have a keep track of their upcoming appointments (without logging in to my site) will able to keep track on their personal calendar (on their phone or on the go). Without integrating with Google Calendar, what other way I can provide them to add their appointments from my site to be able to check on your personal calendars? – knightrider Sep 08 '15 at 07:23
  • And just adding them as an attendee on the event associated to them in your restaurants Google calendar isn't enough? That will send them an email and tell them they have an appointment and they can decide themselves if they want to accept it and add it to there google calendar the one event will be added. Also they wont have to authenticate your application giving you access to their Google Calendar. – Linda Lawton - DaImTo Sep 08 '15 at 07:46
  • You could do what my hair dresser does. They have my phone number they send me a text message to my phone 2 hours before my appointment. You could do the same with an email, email them the day before and remind them. – Linda Lawton - DaImTo Sep 08 '15 at 07:51

1 Answers1

1

As far as I understand your use case from the comments, you actually need to do two different things:

1. Keep the merchant's calendar up to date

For this, a sync might indeed be the best solution. A Calendar API "sync" is just a usual read operation which includes a sync token you can use in later reads to reduce the number of needed operations. It is described in the docs.

2. Add the event to the customer's calendar

You do not want to sync your calendar with the customers' calendar here, just add one event. Of course, you can add an event via the API; however, a much better solution seems to be providing a link for the customer to add the event himself:

https://www.google.com/calendar/render?action=TEMPLATE&text=Your+Event+Name&dates=20150998T224000Z/20150998T221500Z&details=For+details,+link+here:+http://www.example.com&location=Waldorf+Astoria,+301+Park+Ave+,+New+York,+NY+10022&sf=true&output=xml

It is much easier technically, and the customer does not need to give you full access to his calendar (there is no write-only permission).

Community
  • 1
  • 1
P_S
  • 325
  • 1
  • 3
  • 16