Microsoft Graph API:为不是我的用户创建事件 [英] Microsoft Graph API: Create events for users that are not me

查看:57
本文介绍了Microsoft Graph API:为不是我的用户创建事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个小型管理应用程序,该应用程序应在特定的Microsoft日历中创建事件,但我只能以授权用户的身份来执行此操作.

I'm currently developing a small managing app that should create events within a specific Microsoft calendar but I'm only able to do this for me as the authorized user.

是否可以选择仅知道userPrincipalName来为此日历中的每个人创建事件?

Is there an option to create events for everyone in this calendar with only knowing the userPrincipalName?

{
  "subject": "test",
  "body": {
    "contentType": "HTML",
    "content": "Sample Text"
  },
  "start": {
      "dateTime": "2019-04-04T12:00:00",
      "timeZone": "Pacific Standard Time"
  },
  "end": {
      "dateTime": "2019-04-04T14:00:00",
      "timeZone": "Pacific Standard Time"
  },
  "location":{
      "displayName":"Testlocation"
  }
}

https://graph.microsoft.com/v1.0/users/myPricipalName/calendar/events有效,但仅对我有效.

https://graph.microsoft.com/v1.0/users/myPricipalName/calendar/events works but only for me.

整个文档有点让人不知所措

The whole documentation is a bit overwhelming

推荐答案

答案是肯定的,但是您对文档的看法是正确的...

The answer is yes, but you're right about the documentation...

您必须执行以下步骤:

  1. 创建应用程序文档
  2. Microsoft Graph API 添加以下权限在所有邮箱中读写日历.
  3. 授予租户许可(最简单的方法是通过 https://portal.azure.com -> Azure AD->应用程序注册->您的应用程序->设置->所需权限->按钮授予访问权限.
  4. 请求带有客户端ID和密码的令牌,这称为客户端凭据流 https://jwt.ms 上的令牌,以查看令牌是否正确.
  5. 创建事件文档
  6. 通过一些点心来庆祝自己的成就.
  1. Create an application documentation
  2. Add the following permission Read and write calendars in all mailboxes for the Microsoft Graph API.
  3. Grant the permission for your tenant (the easiest way is through https://portal.azure.com -> Azure AD -> App Registrations -> Your App -> Settings -> Required permissions -> Button Grant Access.
  4. Request a token with the client id and secret, this is called the Client credentials flow documentation
  5. (optional) Inspect the token on https://jwt.ms to see if the token is correct.
  6. Create an event documentation
  7. Celebrate your accomplishment with some refreshments.

这篇关于Microsoft Graph API:为不是我的用户创建事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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