Microsoft Graph API-SendMail http 400-文档中的API url不起作用

问题描述:

我的应用程序使用Microsoft Graph发送电子邮件.我们遵循了文档,这已经按预期运行了将近一年:

My application sends email using Microsoft Graph. We followed the documentation, this was working as expected for almost a year:

https://graph.microsoft.com/v1.0/users/me/microsoft.graph.sendmail

自2019年3月8日起,PROD中相同的代码sendmail API开始失败,并显示HTTP 400 - Bad Request:

Since 3/8/2019, the same code sendmail API in PROD started failing with the HTTP 400 - Bad Request:

{
  "error": {
    "code": "TargetIdShouldNotBeMeOrWhitespace",
    "message": "Id is malformed.",
    "innerError": {
      "request-id": "0de5a4eb-dac4-4d98-a4b4-178e503a6657",
      "date": "2019-03-19T17:16:20"
    }
  }
}

作为调查的一部分,我们发现与API帮助部分相比,示例中使用的SendMail文档具有不同的URL.调用此URL时,我们成功了:

As a part of the investigation, we found that the SendMail documentation has a different URL used in the examples than the API help section. We were successful when calling this URL:

https://graph.microsoft.com/v1.0/me/sendmail

问题:

  1. 很显然,2019年3月8日左右Graph API发生了一些更新,从而禁用了早期URL的工作

  1. Clearly looks like there was some update on the Graph API happened around 3/8/2019 that disabled working of the earlier URL

文档中有2个具有误导性/混淆性的URL:一个是API帮助部分,另一个是示例中的URL.到目前为止,帮助部分中的API URL不再起作用.应该使用要使用的正确URL来解决.

Documentation has 2 URL's that are misleading/confusing: one is the API help section and one in examples. As of now the API URL in the help section is no longer working. That should be fixed with the correct URL to be used.

为什么这样的重大更改导致我们的应用程序发生PROD中断?

Why was such breaking change like this introduced that caused a PROD outage for our application?

获得这些更改的官方渠道是什么?

What is the official channel to get these changes?

正确的URI是https://graph.microsoft.com/v1.0/me/microsoft.graph.sendmail(不是/me)

The correct URI is https://graph.microsoft.com/v1.0/me/microsoft.graph.sendmail (not /me)