post: reply

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported.

Reply to a post and add a new post to the specified thread in a group conversation. You can specify both the parent conversation and thread in the request, or, you can specify just the parent thread without the parent conversation.

Permissions

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.All
Delegated (personal Microsoft account) Not supported.
Application Group.ReadWrite.All

HTTP request

POST /groups/{id}/threads/{id}/posts/{id}/reply
POST /groups/{id}/conversations/{id}/threads/{id}/posts/{id}/reply

Request headers

Header Value
Authorization Bearer {token}. Required.

Request body

In the request body, provide a JSON object with the following parameters.

Parameter Type Description
post post The new post that is being replied with.

Response

If successful, this method returns 200 OK response code. It does not return anything in the response body.

Example

Here is an example of how to call this API.

Request

Here is an example of the request.

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

{
  "post": {
    "body": {
      "contentType": "",
      "content": "content-value"
    },
    "receivedDateTime": "2016-10-19T10:37:00Z",
    "hasAttachments": true,
    "from": {
      "emailAddress": {
        "name": "name-value",
        "address": "address-value"
      }
    },
    "sender": {
      "emailAddress": {
        "name": "name-value",
        "address": "address-value"
      }
    },
    "conversationThreadId": "conversationThreadId-value",
    "newParticipants": [
      {
        "emailAddress": {
          "name": "name-value",
          "address": "address-value"
        }
      }
    ],
    "conversationId": "conversationId-value",
    "createdDateTime": "2016-10-19T10:37:00Z",
    "lastModifiedDateTime": "2016-10-19T10:37:00Z",
    "changeKey": "changeKey-value",
    "categories": [
      "categories-value"
    ],
    "id": "id-value",
    "inReplyTo": {
    },
    "attachments": [
      {
        "lastModifiedDateTime": "2016-10-19T10:37:00Z",
        "name": "name-value",
        "contentType": "contentType-value",
        "size": 99,
        "isInline": true,
        "id": "id-value"
      }
    ]
  }
}
Response
Response

Here is an example of the response.

HTTP/1.1 200 OK

SDK sample code


GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var attachments = new Attachment
{
	LastModifiedDateTime = "2016-10-19T10:37:00Z",
	Name = "name-value",
	ContentType = "contentType-value",
	Size = 99,
	IsInline = true,
	Id = "id-value",
};

var attachmentsList = new List<Attachment>();
attachmentsList.Add( attachments );

var inReplyTo = new Post
{
};

var categoriesList = new List<String>();
categoriesList.Add( "categories-value" );

var emailAddress = new EmailAddress
{
	Name = "name-value",
	Address = "address-value",
};

var newParticipants = new Recipient
{
	EmailAddress = emailAddress,
};

var newParticipantsList = new List<Recipient>();
newParticipantsList.Add( newParticipants );

var emailAddress = new EmailAddress
{
	Name = "name-value",
	Address = "address-value",
};

var sender = new Recipient
{
	EmailAddress = emailAddress,
};

var emailAddress = new EmailAddress
{
	Name = "name-value",
	Address = "address-value",
};

var from = new Recipient
{
	EmailAddress = emailAddress,
};

var body = new ItemBody
{
	ContentType = BodyType.Text,
	Content = "content-value",
};

var post = new Post
{
	Body = body,
	ReceivedDateTime = "2016-10-19T10:37:00Z",
	HasAttachments = true,
	From = from,
	Sender = sender,
	ConversationThreadId = "conversationThreadId-value",
	NewParticipants = newParticipantsList,
	ConversationId = "conversationId-value",
	CreatedDateTime = "2016-10-19T10:37:00Z",
	LastModifiedDateTime = "2016-10-19T10:37:00Z",
	ChangeKey = "changeKey-value",
	Categories = categoriesList,
	Id = "id-value",
	InReplyTo = inReplyTo,
	Attachments = attachmentsList,
};

await graphClient.Groups["{id}"].Threads["{id}"].Posts["{id}"]
	.Reply(post)
	.Request()
	.PostAsync()

Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.