简体   繁体   English

Outlook 日历事件同步,如谷歌日历

[英]Outlook calendar events sync like Google Calendar

I have a web application in which users can sign up for "Events".我有一个 web 应用程序,用户可以在其中注册“事件”。 I can sync those events directly to the user's google calendar if they have a gmail email ID registered.如果用户注册了 gmail email ID,我可以将这些事件直接同步到用户的谷歌日历。 I am trying to check if the same is possible for Outlook users.我正在尝试检查 Outlook 用户是否可以这样做。

On checking the Microsoft Graph, they do have the API to create, modify and delete calendar events on Outlook calendar but I am having trouble setting up the authentication and authorization part of it.在检查 Microsoft Graph 时,他们确实有 API 来创建、修改和删除 Outlook 日历上的日历事件,但我在设置它的身份验证和授权部分时遇到了麻烦。 From what I understood they have two ways in which I can use the API - Delegate and Application.据我了解,他们有两种方法可以使用 API - 代表和应用程序。 For delegate API, a UI will pop where it will ask the user to sign in and then all the API will assume that user identity for the operations.对于委托 API,将弹出一个 UI,要求用户登录,然后所有 API 将假定用户身份进行操作。 For Application API, there is no sign in page but no user is associated with the call either, so only generic type of APIs work where no user is involved.对于应用程序 API,没有登录页面,但也没有用户与调用相关联,因此只有通用类型的 API 在不涉及用户的情况下工作。 Since I want to integrate this in the web app, is it possible to have a setup where server is able to send event requests on behalf from my account?由于我想将此集成到 web 应用程序中,是否可以设置服务器能够代表我的帐户发送事件请求?

You can use the following methods:您可以使用以下方法:

  1. Send the user an invite from your account, you will need the webserver to use your account.从您的帐户向用户发送邀请,您将需要网络服务器才能使用您的帐户。 Either by login in yourself and caching & refreshing the token.通过自己登录并缓存和刷新令牌。 Or by using your own tenant and doing it with admin consent and application credentials.或者通过使用您自己的租户并在管理员同意和应用程序凭据的情况下进行操作。
  2. Have the user login and directly add the item to their calendar.让用户登录并直接将项目添加到他们的日历中。 If the user has a business account, you will probably never be authorized to access calendars.如果用户有企业帐户,您可能永远不会被授权访问日历。 Since this is considered as a pretty serious consent.因为这被认为是一个非常严肃的同意。

Alternative way is the offer the event as an ics file.另一种方法是将事件作为 ics 文件提供。 That way the user can download it, and if they have Outlook installed the item will be added to their calendar automatically.这样用户就可以下载它,如果他们安装了 Outlook,该项目将自动添加到他们的日历中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM