POST https://graph.microsoft.com/v1.0/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"
}
}]
}]
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var conversationThread = new ConversationThread
{
Topic = "New Conversation Thread Topic",
Posts = new ConversationThreadPostsCollectionPage()
{
new Post
{
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "this is body content"
},
NewParticipants = new List<Recipient>()
{
new Recipient
{
EmailAddress = new EmailAddress
{
Name = "Alex Darrow",
Address = "alexd@contoso.com"
}
}
}
}
}
};
await graphClient.Groups["{group-id}"].Threads
.Request()
.AddAsync(conversationThread);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new ConversationThread();
$requestBody->setTopic('New Conversation Thread Topic');
$postsPost1 = new Post();
$postsPost1Body = new ItemBody();
$postsPost1Body->setContentType(new BodyType('html'));
$postsPost1Body->setContent('this is body content');
$postsPost1->setBody($postsPost1Body);
$newParticipantsRecipient1 = new Recipient();
$newParticipantsRecipient1EmailAddress = new EmailAddress();
$newParticipantsRecipient1EmailAddress->setName('Alex Darrow');
$newParticipantsRecipient1EmailAddress->setAddress('alexd@contoso.com');
$newParticipantsRecipient1->setEmailAddress($newParticipantsRecipient1EmailAddress);
$newParticipantsArray []= $newParticipantsRecipient1;
$postsPost1->setNewParticipants($newParticipantsArray);
$postsArray []= $postsPost1;
$requestBody->setPosts($postsArray);
$requestResult = $graphServiceClient->groupsById('group-id')->threads()->post($requestBody);