创建对话线程Create conversation thread

重要

Microsoft Graph 中/beta的版本下的 api 可能会发生更改。APIs under the /beta version in Microsoft Graph are subject to change. 不支持在生产应用程序中使用这些 API。Use of these APIs in production applications is not supported.

首先,通过创建线程来启动新的组对话。Start a new group conversation by first creating a thread.

创建新会话、会话线程,然后可在组中创建帖子。使用 回复线程回复帖子 进一步发布到该线程。A new conversation, conversation thread, and post are created in the group. Use reply thread or reply post to further post to that thread.

注意:你还可以 在现有会话中启动新线程Note: You can also start a new thread in an existing conversation.

权限Permissions

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

权限类型Permission type 权限(从最低特权到最高特权)Permissions (from least to most privileged)
委派(工作或学校帐户)Delegated (work or school account) Group.ReadWrite.AllGroup.ReadWrite.All
委派(个人 Microsoft 帐户)Delegated (personal Microsoft account) 不支持。Not supported.
应用程序Application 不支持。Not supported.

HTTP 请求HTTP request

POST /groups/{id}/threads

请求标头Request headers

标头Header Value
AuthorizationAuthorization Bearer {token}。必需。Bearer {token}. Required.
Content-TypeContent-Type application/jsonapplication/json

请求正文Request body

在请求正文中,提供代表包括 帖子conversationThread 的 JSON 表示形式。In the request body, supply a JSON representation of conversationThread object containing a post.

响应Response

如果成功,此方法在响应正文中返回 201 Created 响应代码和 conversationThread 对象。If successful, this method returns 201 Created response code and conversationThread object in the response body.

示例Example

请求Request

下面展示了示例请求。The following is an example of the request.

POST https://graph.microsoft.com/beta/groups/{id}/threads
Content-type: application/json

{
  "topic": "New Conversation Thread Topic",
  "posts": [{
    "body": {
      "contentType": "html",
      "content": "this is body content"
    },
    "newParticipants": [{
      "emailAddress": {
        "name": "Alex Darrow",
        "address": "alexd@contoso.com"
      }
    }]
  }]
}

响应Response

下面是一个响应示例。The following is an example of the response.

注意: 为了提高可读性,可能缩短了此处显示的响应对象。Note: The response object shown here might be shortened for readability. 所有属性都将通过实际调用返回。All the properties will be returned from an actual call.

HTTP/1.1 201 OK
Content-type: application/json
Content-length: 419

{
  "toRecipients": [
    {
      "emailAddress": {
        "name": "name-value",
        "address": "address-value"
      }
    }
  ],
  "topic": "topic-value",
  "hasAttachments": true,
  "lastDeliveredDateTime": "2016-10-19T10:37:00Z",
  "uniqueSenders": [
    "uniqueSenders-value"
  ],
  "ccRecipients": [
    {
      "emailAddress": {
        "name": "name-value",
        "address": "address-value"
      }
    }
  ]
}