post: reply post: reply
02/02/2021
Tiempo de lectura: 2 minutos
En este artículo
Espacio de nombres: microsoft.graph Namespace: microsoft.graph
Responde a una publicación y agrega una nueva publicación al hilo especificado de una conversación de grupo. Reply to a post and add a new post to the specified thread in a group conversation.
Puede especificar la conversación y el hilo primarios en la solicitud, o bien, especificar solo el hilo primario sin la conversación primaria. You can specify both the parent conversation and thread in the request, or, you can specify just the parent thread without the parent conversation.
Permisos Permissions
Se requiere uno de los siguientes permisos para llamar a esta API. Para obtener más información, incluido cómo elegir permisos, vea Permisos . One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions .
Tipo de permiso Permission type
Permisos (de menos a más privilegiados) Permissions (from least to most privileged)
Delegado (cuenta profesional o educativa) Delegated (work or school account)
Group.ReadWrite.All Group.ReadWrite.All
Delegado (cuenta personal de Microsoft) Delegated (personal Microsoft account)
No admitida. Not supported.
Aplicación Application
Group.ReadWrite.All Group.ReadWrite.All
Solicitud HTTP HTTP request
POST /groups/{id}/threads/{id}/posts/{id}/reply
POST /groups/{id}/conversations/{id}/threads/{id}/posts/{id}/reply
Encabezado Header
Valor Value
Authorization Authorization
{token} de portador. Obligatorio. Bearer {token}. Required.
Cuerpo de la solicitud Request body
En el cuerpo de la solicitud, proporcione un objeto JSON con los siguientes parámetros. In the request body, provide a JSON object with the following parameters.
Parámetro Parameter
Tipo Type
Descripción Description
post post
post post
La nueva publicación con que se responde. The new post that is being replied with.
Respuesta Response
Si se ejecuta correctamente, este método devuelve el código de respuesta 202 Accepted
. No devuelve nada en el cuerpo de la respuesta. If successful, this method returns 202 Accepted
response code. It does not return anything in the response body.
Ejemplo Example
Aquí tiene un ejemplo de cómo llamar a esta API. Here is an example of how to call this API.
Solicitud Request
Aquí tiene un ejemplo de la solicitud. Here is an example of the request.
POST https://graph.microsoft.com/v1.0/groups/{id}/threads/{id}/posts/{id}/reply
Content-type: application/json
Content-length: 1131
{
"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["{id}"].Threads["{id}"].Posts["{id}"]
.Reply(post)
.Request()
.PostAsync();
Lea la documentación del SDK para obtener más información sobre cómo Agregar el SDK a su proyecto y crear una instancia de authProvider. Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.
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"
}
]
}
};
let res = await client.api('/groups/{id}/threads/{id}/posts/{id}/reply')
.post(reply);
Lea la documentación del SDK para obtener más información sobre cómo Agregar el SDK a su proyecto y crear una instancia de authProvider. Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.
IGraphServiceClient 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 = CalendarSerializer.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 = CalendarSerializer.deserialize("datetime-value");
post.lastModifiedDateTime = CalendarSerializer.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 = CalendarSerializer.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(post)
.buildRequest()
.post();
Lea la documentación del SDK para obtener más información sobre cómo Agregar el SDK a su proyecto y crear una instancia de authProvider. Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.
Respuesta Response
Aquí tiene un ejemplo de la respuesta. Here is an example of the response.
HTTP/1.1 202 Accepted