Um thread e uma postagem são criados conforme especificado. Use responder ao thread para incluir postagens adicionais no thread. Ou, se receber a ID de postagem, você também poderá responder a essa postagem no thread.
POST https://graph.microsoft.com/v1.0/groups/{id}/conversations/{id}/threads
Content-type: application/json
{
"topic": "Take your wellness days and rest",
"posts": [
{
"body": {
"contentType": "html",
"content": "Waiting for the summer holidays."
}
}
]
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var conversationThread = new ConversationThread
{
Topic = "Take your wellness days and rest",
Posts = new ConversationThreadPostsCollectionPage()
{
new Post
{
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "Waiting for the summer holidays."
}
}
}
};
await graphClient.Groups["{group-id}"].Conversations["{conversation-id}"].Threads
.Request()
.AddAsync(conversationThread);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewConversationThread()
topic := "Take your wellness days and rest"
requestBody.SetTopic(&topic)
requestBody.SetPosts( []Post {
msgraphsdk.NewPost(),
body := msgraphsdk.NewItemBody()
SetBody(body)
contentType := "html"
body.SetContentType(&contentType)
content := "Waiting for the summer holidays."
body.SetContent(&content)
}
groupId := "group-id"
conversationId := "conversation-id"
result, err := graphClient.GroupsById(&groupId).ConversationsById(&conversationId).Threads().Post(requestBody)
No corpo da solicitação, forneça uma representação JSON do objeto ConversationThread.
Resposta
Se for bem-sucedido, este método retornará um código de resposta 201 Created e o id do novo thread no corpo da resposta.
Este é um exemplo de resposta.