【问题标题】:Creating a Microsoft Graph webhook subscription to security/alerts fails为安全/警报创建 Microsoft Graph webhook 订阅失败
【发布时间】:2018-11-14 20:27:17
【问题描述】:

当我尝试为安全/警报端点创建 Microsoft Graph Webhook 订阅时,订阅创建失败并显示如下所示的一般消息。将资源修改为“我/消息”会导致创建成功的 webhook 订阅,因此这似乎特定于安全/警报端点。我该如何克服这个问题?

请求的正文如下:

{
  "changeType": "created",
  "notificationUrl": "https://xxxxxxxxx.azurewebsites.net/api/graphnotifications",
  "resource": "security/alerts?$filter=vendorInformation/provider+eq+'ASC'",
  "expirationDateTime": "2018-11-15T11:00:00.0000000Z",
  "clientState": "secretClientValue"
}

【问题讨论】:

  • Wes,你能分享一下你在这里使用的实际请求 url 吗?只是为了双重确定。

标签: microsoft-graph-api microsoft-graph-security


【解决方案1】:

请使用“更新”作为“更改类型”。安全/警报对所有新的或更新的警报使用“更新”。

【讨论】:

  • 完美,这解决了问题。建议在 400 中添加更多描述性反馈,并可能更新文档以在示例 changeType 中不包含“created”。
【解决方案2】:

韦斯,您没有发布您向其发送请求的 URL。根据安全警报的文档。

您可以使用 Microsoft Graph Webhook 订阅和接收有关 Microsoft Graph 安全实体更新的通知。

https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/security-api-overview

在该页面上,它声明发布请求并提供这样的示例

POST https://graph.microsoft.com/v1.0/subscriptions
Content-Type: application/json
{
  "changeType": "created,updated",
  "notificationUrl": "https://webhook.azurewebsites.net/notificationClient",
  "resource": "/me/mailfolders('inbox')/messages",
  "expirationDateTime": "2016-03-20T11:00:00.0000000Z",
  "clientState": "SecretClientState"
}

https://developer.microsoft.com/en-us/graph/docs/concepts/webhooks

您是否将该请求正文发布到该网址?

【讨论】:

    猜你喜欢
    • 2019-05-15
    • 1970-01-01
    • 2019-05-29
    • 2023-03-23
    • 1970-01-01
    • 2020-02-10
    • 2019-01-17
    • 2019-03-20
    • 2022-08-24
    相关资源
    最近更新 更多