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();
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、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);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、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();
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、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)
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、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
SDK をプロジェクトに追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。