Microsoft Graph API:为不是我的用户创建事件 [英] Microsoft Graph API: Create events for users that are not me
问题描述
我目前正在开发一个小型管理应用程序,该应用程序应在特定的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...
您必须执行以下步骤:
- 创建应用程序文档
- 为 Microsoft Graph API 添加以下权限在所有邮箱中读写日历.
- 授予租户许可(最简单的方法是通过 https://portal.azure.com -> Azure AD->应用程序注册->您的应用程序->设置->所需权限->按钮授予访问权限.
- 请求带有客户端ID和密码的令牌,这称为客户端凭据流 https://jwt.ms 上的令牌,以查看令牌是否正确.
- 创建事件文档
- 通过一些点心来庆祝自己的成就.
- Create an application documentation
- Add the following permission Read and write calendars in all mailboxes for the Microsoft Graph API.
- 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.
- Request a token with the client id and secret, this is called the Client credentials flow documentation
- (optional) Inspect the token on https://jwt.ms to see if the token is correct.
- Create an event documentation
- Celebrate your accomplishment with some refreshments.
这篇关于Microsoft Graph API:为不是我的用户创建事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!