Integrate my website with google calendar

青春壹個敷衍的年華 提交于 2020-01-13 20:28:28

问题


Im developing a website in PHP. The users of this site are allowed to book appointments from the calendar that i have provided. When a user makes a booking it should be added to my google calendar.

What kind of authentication mechanism would i need for this type of scenario? Which one from the following? 1. Web applications 2. Service accounts 3. Installed applications

NB: I dont want to access my site user's google calendar. I just want their booking be shown in my google calendar. And, if possible, please post a source where i can get started on the coding. I searched but most tutorials on this topic are based on .NET.

Thanks.


回答1:


You will need to setup an OAuth interface with the Google Calendar API. But instead of using OAuth to connect to the user's Google Calendar, you will set it up so that it always connects to your Google Calendar. If you go into the Google Documentation for the Calendar API, they have section called Write your First App. This has sample code in multiple languages including PHP. It's a good place to start.

NOTE: When I say that it will use your account, what I mean is that you set it up like you are a customer and connect via OAuth to get the tokens. Then save those tokens and use them for all accesses to Google Calendar. Since the tokens are into your account, you will always be connecting to your Calendar.



来源:https://stackoverflow.com/questions/11289050/integrate-my-website-with-google-calendar

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