microsoft graph api在订阅请求时提供internalservererror

k97glaaz  于 2021-07-09  发布在  Java
关注(0)|答案(2)|浏览(353)

我当前正在从outlook api迁移到microsoft graph api,当我尝试订阅日历和事件的推送通知时(就像在outlook中一样),出现了一个错误:

{
"error": {
"code": "InternalServerError",
"message": "Object reference not set to an instance of an object.",
"innerError": {
  "request-id": "130ef895-4741-472e-9155-73fcb38a487f",
  "date": "2017-07-14T11:40:11"
}
}
}

要进行身份验证,我使用端点:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
当我将请求发送到:
https://graph.microsoft.com/v1.0/subscriptions

{
"id": null,
"resource": "users/me/events/calendars/{calendarId}/events",
"notificationUrl": "https://myapp:8080/MyService/notifications/",
"clientState": null,
"@odata.type": null,
"@odata.id": null,
"@odata.context": null,
"changeType": "created,updated,deleted",
"expirationDateTime": "2017-07-19T11:40:10Z"
}

我发现有几个案例有相同的错误,但它们完全位于不同的区域(不是订阅)。这里怎么了?我试着用graph subscription beta来回答这个问题:“没有找到段的资源”,但是,这个解决方案在我的例子中不起作用。

ffx8fchx

ffx8fchx1#

删除有效负载中设置为 null . 将有效载荷设置为:

{
  "resource": "users/me/events/calendars/{calendarId}/events",
  "notificationUrl": "https://myapp:8080/MyService/notifications/",
  "changeType": "created,updated,deleted",
  "expirationDateTime": "2017-07-19T11:40:10Z"
}
h7appiyu

h7appiyu2#

从您的http响应中,您能给我x-beserver http响应头值以及这些空ref错误响应之一的请求id和日期时间吗?这样我就可以拉木头看看发生了什么。

相关问题