我在 Azure 上注册了一个 Web 应用程序,目的是能够读取和写入其他用户的日历。为此,我在 Azure 上为此应用设置了这些权限。
但是,例如,当我尝试为给定用户创建一个新事件时,我会收到一条错误消息。这是我正在使用的:
端点
https://graph.microsoft.com/v1.0/users/${requester}/calendar/events
HTTP 标头
Content-Type application/json
请求正文
{
"subject": "${subject}",
"body": {
"contentType": "HTML",
"content": "${remarks}"
},
"start": {
"dateTime": "${startTime}",
"timeZone": "${timezone}"
},
"end": {
"dateTime": "${endTime}",
"timeZone": "${timezone}"
},
"location": {
"displayName": "${spaceName}",
"locationEmailAddress": "${spaceEmail}"
},
"attendees": [
{
"emailAddress": {
"address": "${spaceEmail}",
"name": "${spaceName}"
},
"type": "resource"
}
]
}
错误信息
{
"error": {
"code": "ErrorItemNotFound",
"message": "The specified object was not found in the store.",
"innerError": {
"request-id": "XXXXXXXXXXXXXXXX",
"date": "2018-07-11T09:16:19"
}
}
}
有什么我想念的吗?提前感谢您的帮助!
解决方案更新
我设法按照此链接中描述的步骤解决了这个问题: https ://developer.microsoft.com/en-us/graph/docs/concepts/auth_v2_service