outlook - 同时添加附件时出现412(前提条件失败)

标签 outlook microsoft-graph-api

我正在使用 Microsoft Graph。我尝试添加两个附件

POST /me/messages/{messageId}/attachment

{
  "@odata.type": "#microsoft.graph.fileAttachment",
  "name": "1.txt",
  "contentBytes": "SGVsbG8gd29ybGQh"
}

POST /me/messages/{messageId}/attachment

{
  "@odata.type": "#microsoft.graph.fileAttachment",
  "name": "2.txt",
  "contentBytes": "SGVsbG8gd29ybGQhIQ=="
}

它给了我 412(前提条件失败)同时添加这两个附件时出错。
{
  "code": "ErrorIrresolvableConflict",
  "message": "The send or update operation could not be performed because the change key passed in the request does not match the current change key for the item., Cannot save changes made to an item to store.SaveStatus: IrresolvableConflict\r\nPropertyConflicts:\r\n",
  "innerError": {
    "request-id": "20e95141-5d2d-41e3-8eed-3bbd24bcf52a",
    "date": "2017-11-28T07:18:45"
  }
}

最佳答案

现在,绕行方式将第二次 POST 延迟大约 100 毫秒。如果小于 100 毫秒,则更有可能失败。 (失败的几率也可能和附件大小有关,我没有做进一步的测试)

但是如果我有 10 个附件,在每两个 POST 之间,会有 100 毫秒的延迟。

顺便说一句,我看到这个问题甚至存在于 Outlook 客户端中,当人们发送邮件时,他们得到同样的错误:检查 here .所以可能是服务器问题。

[从我原来的问题开始回答]

关于outlook - 同时添加附件时出现412(前提条件失败),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47526141/

相关文章:

RDCOMClient 与 COMCreate ("Outlook.Application") 崩溃 R

vba - Outlook VBA 将 .xls 附件转换为 .xlsx

c# - Outlook 拒绝来自 CryptProtectData() 的密码

javascript - 如何将 json 响应中的二进制图像保存到 S3 存储桶

azure - 使用客户端凭据身份验证通过 Graph API 创建自定义扩展

c# - Microsoft Graph .NET SDK - 检索 ListItem 字段

python - 微软图形 API : Authorization_IdentityNotFound

vba - 自动接受 Outlook VBA

c# - 如何根据唯一标识符动态创建安装文件?

azure - Azure AD Graph API 和 Microsoft Graph API 之间有什么区别