我正在从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"
}
我发现几个具有相同错误的案例,但它们完全处于不同的区域(不是订阅) . 这可能有什么不对?我试着按照这个问题:"Resource not found for the segment" using Graph subscription beta,但是,解决方案在我的情况下不起作用 .
2 回答
删除您设置为
null
的有效内容中的所有字段 . 像这样制作你的有效载荷:从您的HTTP响应中,您能否为我提供X-BEServer HTTP响应标头值以及其中一个空引用错误响应的请求ID和日期时间?这样我就可以拉日志,看看发生了什么 .