简体   繁体   English

Microsoft Graph:作为管理员,在用户日历中创建事件

[英]Microsoft Graph: as Admin, create events in user calendar

I'm building an application, which will need to send requests to Microsoft Graph , and create events in Office 365 Calendar.我正在构建一个应用程序,该应用程序需要向Microsoft Graph发送请求,并在Office 365日历中创建事件。

I'm using events endpoint:我正在使用事件端点:

'users /' + graphdata ['userPrincipalName'] + '/ events'

There's no problems when I create events for the account accessing the app.为访问应用程序的帐户创建事件时没有问题。

But I would like to, as ADMIN, grant permission to create these events in the calendar of other users.但作为管理员,我想授予在其他用户的日历中创建这些事件的权限。

I have look in the documentation for some permissions, among the admin permissions, that would allow me to do this, but I did not find anything.我在文档中查看了一些权限,在管理员权限中,这将允许我执行此操作,但我没有找到任何内容。

Does anyone know of any way to do this in Microsoft Graph?有谁知道在 Microsoft Graph 中有什么方法可以做到这一点?

I initially believed that the endpoint users / '+ graphdata [' userPrincipalName '] +' / events allowed this because one of the parameters is the username of the email account.我最初认为端点users / '+ graphdata [' userPrincipalName '] +' / events允许这样做,因为参数之一是电子邮件帐户的用户名。

The error I get when I try to use this endpoit with another user is: 404: ErrorItemNotFound - The specified object was not found in this store.当我尝试与其他用户一起使用此端点时出现的错误是: 404: ErrorItemNotFound - The specified object was not found in this store.

When you're authenticated as a user you are using Delegated scopes and you only have access to their mailbox (and any shared with them).当您作为用户进行身份验证时,您使用的是委托范围,并且您只能访问他们的邮箱(以及与他们共享的任何邮箱)。

If you want to create events on calendars on any account, you need to use the Client Credentials OAuth grant and Application scopes.如果要在任何帐户的日历上创建事件,则需要使用客户端凭据 OAuth 授权和应用程序范围。 This process is documented under Get access without a user .此过程记录在没有用户的情况获取访问权限下

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

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