Responda a uma postagem e adicione uma nova postagem ao thread especificado em uma conversa de grupo.
Você pode especificar a conversa pai e o thread na solicitação ou pode especificar apenas o thread pai, sem a conversa pai.
Uma das seguintes permissões é obrigatória para chamar esta API. Para saber mais, incluindo como escolher permissões, confira Permissões.
Forneça um objeto JSON com os seguintes parâmetros no corpo da solicitação.
Eis um exemplo de como chamar esta API.
Este é um exemplo da solicitação.
POST https://graph.microsoft.com/v1.0/groups/{id}/threads/{id}/posts/{id}/reply
Content-type: application/json
{
"post": {
"body": {
"contentType": "",
"content": "content-value"
},
"receivedDateTime": "datetime-value",
"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": "datetime-value",
"lastModifiedDateTime": "datetime-value",
"changeKey": "changeKey-value",
"categories": [
"categories-value"
],
"id": "id-value",
"inReplyTo": {
},
"attachments": [
{
"@odata.type": "#microsoft.graph.fileAttachment",
"lastModifiedDateTime": "datetime-value",
"name": "name-value",
"contentType": "contentType-value",
"size": 99,
"isInline": true,
"id": "id-value"
}
]
}
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var post = new Post
{
Body = new ItemBody
{
ContentType = BodyType.Text,
Content = "content-value"
},
ReceivedDateTime = DateTimeOffset.Parse("datetime-value"),
HasAttachments = true,
From = new Recipient
{
EmailAddress = new EmailAddress
{
Name = "name-value",
Address = "address-value"
}
},
Sender = new Recipient
{
EmailAddress = new EmailAddress
{
Name = "name-value",
Address = "address-value"
}
},
ConversationThreadId = "conversationThreadId-value",
NewParticipants = new List<Recipient>()
{
new Recipient
{
EmailAddress = new EmailAddress
{
Name = "name-value",
Address = "address-value"
}
}
},
ConversationId = "conversationId-value",
CreatedDateTime = DateTimeOffset.Parse("datetime-value"),
LastModifiedDateTime = DateTimeOffset.Parse("datetime-value"),
ChangeKey = "changeKey-value",
Categories = new List<String>()
{
"categories-value"
},
Id = "id-value",
InReplyTo = new Post
{
},
Attachments = new PostAttachmentsCollectionPage()
{
new FileAttachment
{
LastModifiedDateTime = DateTimeOffset.Parse("datetime-value"),
Name = "name-value",
ContentType = "contentType-value",
Size = 99,
IsInline = true,
Id = "id-value"
}
}
};
await graphClient.Groups["{group-id}"].Threads["{conversationThread-id}"].Posts["{post-id}"]
.Reply(post)
.Request()
.PostAsync();
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do SDK.
const options = {
authProvider,
};
const client = Client.init(options);
const reply = {
post: {
body: {
contentType: '',
content: 'content-value'
},
receivedDateTime: 'datetime-value',
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: 'datetime-value',
lastModifiedDateTime: 'datetime-value',
changeKey: 'changeKey-value',
categories: [
'categories-value'
],
id: 'id-value',
inReplyTo: {
},
attachments: [
{
'@odata.type': '#microsoft.graph.fileAttachment',
lastModifiedDateTime: 'datetime-value',
name: 'name-value',
contentType: 'contentType-value',
size: 99,
isInline: true,
id: 'id-value'
}
]
}
};
await client.api('/groups/{id}/threads/{id}/posts/{id}/reply')
.post(reply);
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do SDK.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Post post = new Post();
ItemBody body = new ItemBody();
body.contentType = BodyType.TEXT;
body.content = "content-value";
post.body = body;
post.receivedDateTime = OffsetDateTimeSerializer.deserialize("datetime-value");
post.hasAttachments = true;
Recipient from = new Recipient();
EmailAddress emailAddress = new EmailAddress();
emailAddress.name = "name-value";
emailAddress.address = "address-value";
from.emailAddress = emailAddress;
post.from = from;
Recipient sender = new Recipient();
EmailAddress emailAddress1 = new EmailAddress();
emailAddress1.name = "name-value";
emailAddress1.address = "address-value";
sender.emailAddress = emailAddress1;
post.sender = sender;
post.conversationThreadId = "conversationThreadId-value";
LinkedList<Recipient> newParticipantsList = new LinkedList<Recipient>();
Recipient newParticipants = new Recipient();
EmailAddress emailAddress2 = new EmailAddress();
emailAddress2.name = "name-value";
emailAddress2.address = "address-value";
newParticipants.emailAddress = emailAddress2;
newParticipantsList.add(newParticipants);
post.newParticipants = newParticipantsList;
post.conversationId = "conversationId-value";
post.createdDateTime = OffsetDateTimeSerializer.deserialize("datetime-value");
post.lastModifiedDateTime = OffsetDateTimeSerializer.deserialize("datetime-value");
post.changeKey = "changeKey-value";
LinkedList<String> categoriesList = new LinkedList<String>();
categoriesList.add("categories-value");
post.categories = categoriesList;
post.id = "id-value";
Post inReplyTo = new Post();
post.inReplyTo = inReplyTo;
LinkedList<Attachment> attachmentsList = new LinkedList<Attachment>();
FileAttachment attachments = new FileAttachment();
attachments.lastModifiedDateTime = OffsetDateTimeSerializer.deserialize("datetime-value");
attachments.name = "name-value";
attachments.contentType = "contentType-value";
attachments.size = 99;
attachments.isInline = true;
attachments.id = "id-value";
attachmentsList.add(attachments);
AttachmentCollectionResponse attachmentCollectionResponse = new AttachmentCollectionResponse();
attachmentCollectionResponse.value = attachmentsList;
AttachmentCollectionPage attachmentCollectionPage = new AttachmentCollectionPage(attachmentCollectionResponse, null);
post.attachments = attachmentCollectionPage;
graphClient.groups("{id}").threads("{id}").posts("{id}")
.reply(PostReplyParameterSet
.newBuilder()
.withPost(post)
.build())
.buildRequest()
.post();
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do SDK.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewPostRequestBody()
post := msgraphsdk.NewPost()
requestBody.SetPost(post)
body := msgraphsdk.NewItemBody()
post.SetBody(body)
contentType := ""
body.SetContentType(&contentType)
content := "content-value"
body.SetContent(&content)
receivedDateTime, err := time.Parse(time.RFC3339, "datetime-value")
post.SetReceivedDateTime(&receivedDateTime)
hasAttachments := true
post.SetHasAttachments(&hasAttachments)
from := msgraphsdk.NewRecipient()
post.SetFrom(from)
emailAddress := msgraphsdk.NewEmailAddress()
from.SetEmailAddress(emailAddress)
name := "name-value"
emailAddress.SetName(&name)
address := "address-value"
emailAddress.SetAddress(&address)
sender := msgraphsdk.NewRecipient()
post.SetSender(sender)
emailAddress := msgraphsdk.NewEmailAddress()
sender.SetEmailAddress(emailAddress)
name := "name-value"
emailAddress.SetName(&name)
address := "address-value"
emailAddress.SetAddress(&address)
conversationThreadId := "conversationThreadId-value"
post.SetConversationThreadId(&conversationThreadId)
post.SetNewParticipants( []Recipient {
msgraphsdk.NewRecipient(),
SetAdditionalData(map[string]interface{}{
}
}
conversationId := "conversationId-value"
post.SetConversationId(&conversationId)
createdDateTime, err := time.Parse(time.RFC3339, "datetime-value")
post.SetCreatedDateTime(&createdDateTime)
lastModifiedDateTime, err := time.Parse(time.RFC3339, "datetime-value")
post.SetLastModifiedDateTime(&lastModifiedDateTime)
changeKey := "changeKey-value"
post.SetChangeKey(&changeKey)
post.SetCategories( []String {
"categories-value",
}
id := "id-value"
post.SetId(&id)
inReplyTo := msgraphsdk.NewPost()
post.SetInReplyTo(inReplyTo)
post.SetAttachments( []Attachment {
msgraphsdk.NewAttachment(),
lastModifiedDateTime, err := time.Parse(time.RFC3339, "datetime-value")
SetLastModifiedDateTime(&lastModifiedDateTime)
name := "name-value"
SetName(&name)
contentType := "contentType-value"
SetContentType(&contentType)
size := int32(99)
SetSize(&size)
isInline := true
SetIsInline(&isInline)
id := "id-value"
SetId(&id)
SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.fileAttachment",
}
}
groupId := "group-id"
conversationThreadId := "conversationThread-id"
postId := "post-id"
graphClient.GroupsById(&groupId).ThreadsById(&conversationThreadId).PostsById(&postId).Reply(group-id, conversationThread-id, post-id).Post(requestBody)
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do SDK.
Import-Module Microsoft.Graph.Groups
$params = @{
Post = @{
Body = @{
ContentType = ""
Content = "content-value"
}
ReceivedDateTime = [System.DateTime]::Parse("datetime-value")
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 = [System.DateTime]::Parse("datetime-value")
LastModifiedDateTime = [System.DateTime]::Parse("datetime-value")
ChangeKey = "changeKey-value"
Categories = @(
"categories-value"
)
Id = "id-value"
InReplyTo = @{
}
Attachments = @(
@{
"@odata.type" = "#microsoft.graph.fileAttachment"
LastModifiedDateTime = [System.DateTime]::Parse("datetime-value")
Name = "name-value"
ContentType = "contentType-value"
Size = 99
IsInline = $true
Id = "id-value"
}
)
}
}
Invoke-MgReplyGroupThreadPost -GroupId $groupId -ConversationThreadId $conversationThreadId -PostId $postId -BodyParameter $params
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do SDK.
Veja a seguir um exemplo da resposta.