Google Calendar API-设计用于? [英] Google Calendar API - Designed for?

查看:89
本文介绍了Google Calendar API-设计用于?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用FullCalendar Javascript实现Google Calendar API. 在开始编码之前,我有一些问题需要了解Google Calendar API的主要目的.

I would like to implement a Google Calendar API using FullCalendar Javascript. Before any start of coding I have some problem to understand what is the main purpose of the Google Calendar API.

如您所知,在创建和启用API之前,需要进行一些Auth处理. 这意味着我作为所有者或开发人员想使用Google Calendar API,这样我就可以获取客户端/秘密/密钥字符串,而且还可以.

As you know there is some Auth process before creation and enabling API. That means that I, as owner or developer want to use Google Calendar API so I get client/secret/keys strings and it is OK.

我可以创建一个应用,在其中可以推广"公开的Google帐户日历,然后可以显示该日历中的所有事件(牙医预订等).

I can create an app where I can "promote" my Google Account Calendar being public and then I can show all events from that calendar (dentist booking etc).

我还可以通过其他方式使用日历.例如:在我的应用程序中,我可以创建一个页面,用户可以在其中验证其Google帐户并查看其事件 已经创建. 但是,如果我登录的用户没有Google帐户该怎么办. Google日历与已创建的Google帐户紧密相连吗?是否可以将Google Calendar严格用作REST API? 我知道这可能是一个愚蠢的问题,但这是大多数Google Calendar API初学者都会遇到的问题.

Also I am able to use Calendar in another way. For example: Within my App I can create one page where users can auth to their google accounts and see their events are already created. But, What if my logged users don't have a Google Accounts. Google Calendar is strongly connected to already created google accounts? Is it possible to use Google Calendar strictly as an REST API? I know that this may be a stupid questions but this is something that most of Google Calendar API beginners have problem with.

推荐答案

从技术上讲,有两种方法可以访问Google日历上的日历.

There are technically two ways of accessing a calendar on Google Calendar.

您的第一个选择是使用 Oauth2 进行身份验证的地方用户.他们为您提供了访问其Google日历的权限,然后您可以将事件直接插入其日历中.您还可以查看它们当前发生的事件.如您所说,如果有问题的用户没有Google帐户,这将无法正常工作.

Your first option is where you are using Oauth2 to authenticate your users. They give you access to their google calendar and you can then insert events directly into their calendar. You can also see the events that they currently have. This as you said wont work if the user in question does not have a google account.

您的第二个选择是使用称为服务帐户.将服务帐户视为虚拟用户.它有自己的Google日历帐户减去网络视图.您可能希望我们将事件存储在全局日历应用程序日历中.然后,当您想将用户添加到活动中时,您可以邀请他们设置通知,否,他们应该收到电子邮件,他们将能够将活动添加到他们自己的个人日历中.对您来说,这样做可能会更好,因为它不需要您访问Users google日历,唯一的缺点就是您无法查看该用户当时是否正在发生任何事件,因为您没有无法访问其帐户进行检查.

Your second option is to use something called a service account. Think of a service account as a dummy user. It has its own Google calendar account minus the web view. You could potentially us that to store events in a global calendar application calendar. Then when you want to add a user to an event you invite them you can set notification no they should receive an email and they will them be able to add the event to their own personal calendar. For you this may work out better because it does not require you to have access to the Users google calendar the only draw back will be there is no way for you to see if said user has any events going on at that time since you don't have access to their account to check.

我给了您一些我几年前写的教程的链接,这些教程解释了oauth2和服务帐户之间的区别.

I have given you a couple of links to some tutorials that I have write a few years ago that explains the difference between oauth2 and service accounts.

这篇关于Google Calendar API-设计用于?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆