在Microsoft Graph

时间:2016-02-15 13:44:12

标签: microsoft-graph

我正在使用Fiddler为我的对话创建一个新主题,并且我正在遵循文档here并且我收到此错误:

message="Posts" property missing in create conversation request body.

我真的很奇怪,我使用的是文档中的确切请求模型。

POST https://graph.microsoft.com/v1.0/groups/<id>/conversations/<id>/threads
Content-type: application/json
Content-length: 419

{
  "toRecipients": [
    {
      "emailAddress": {
        "name": "name-value",
        "address": "address-value"
      }
    }
  ],
  "topic": "topic-value",
  "hasAttachments": true,
  "lastDeliveredDateTime": "datetime-value",
  "uniqueSenders": [
    "uniqueSenders-value"
  ],
  "ccRecipients": [
    {
      "emailAddress": {
        "name": "name-value",
        "address": "address-value"
      }
    }
  ]
}

据我所知,显然Posts属性丢失了,但这个属性应放在哪里?

像这样,

  "topic": "topic-value",
  "Posts": "This is a post"     <<<
  "hasAttachments": true,

没有工作并抛出以下错误消息:

"message": "Property Posts in payload has a value that does not match schema."

我非常感谢您对此问题的投入。

非常感谢提前!

修改: 在示例模型中添加了以下内容,我能够创建一个新线程: "posts": [{}]

1 个答案:

答案 0 :(得分:1)

基本上我使用了相同的模型,但添加了一个posts属性,我设法创建了一个新的线程:

{
  "toRecipients": [
    {
      "emailAddress": {
        "name": "name-value",
        "address": "address-value"
      }
    }
  ],
  "topic": "topic-value",
  "hasAttachments": true,
  "lastDeliveredDateTime": "datetime-value",
  "uniqueSenders": [
    "uniqueSenders-value"
  ],
  "posts": [{}],   <<<< HERE, empty post
  "ccRecipients": [
    {
      "emailAddress": {
        "name": "name-value",
        "address": "address-value"
      }
    }
  ]
}

我认为帖子的构成是: "posts": [{ "body": { "contentType": "html", "content": "this is body content" },

希望将来可以帮助其他人。