名前空間: microsoft.graph
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
1 つのチャット メッセージまたはチャット内の複数のチャット メッセージに引用符で返信します。
注:
複数のメッセージに引用符で返信する場合、最大 10 個のメッセージを応答に使用できます。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
✅ |
✅ |
✅ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
ChatMessage.Send |
注意事項なし。 |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
サポートされていません。 |
サポートされていません。 |
HTTP 要求
POST /chats/{chatId}/messages/replyWithQuote
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
| Content-Type |
application/json. 必須です。 |
要求本文
要求本文で、パラメーターの JSON 表現を指定します。
次の表に、このアクションで使用できるパラメーターを示します。
| パラメーター |
型 |
説明 |
| messageIds |
String collection |
見積もりで返信されるチャット内のメッセージ ID の一覧。 |
| replyMessage |
chatMessage |
応答のメッセージ本文。 |
応答
成功した場合、このメソッドは 201 Created 応答コードと、応答本文で chatMessage オブジェクトを返します。
例
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/beta/chats/19:97641583cf154265a237da28ebbde27a@thread.v2/messages/replyWithQuote
Content-Type: application/json
{
"messageIds": [
"1728088338580"
],
"replyMessage": {
"body": {
"content": "Hello World"
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Chats.Item.Messages.ReplyWithQuote;
using Microsoft.Graph.Beta.Models;
var requestBody = new ReplyWithQuotePostRequestBody
{
MessageIds = new List<string>
{
"1728088338580",
},
ReplyMessage = new ChatMessage
{
Body = new ItemBody
{
Content = "Hello World",
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Chats["{chat-id}"].Messages.ReplyWithQuote.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphchats "github.com/microsoftgraph/msgraph-beta-sdk-go/chats"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphchats.NewReplyWithQuotePostRequestBody()
messageIds := []string {
"1728088338580",
}
requestBody.SetMessageIds(messageIds)
replyMessage := graphmodels.NewChatMessage()
body := graphmodels.NewItemBody()
content := "Hello World"
body.SetContent(&content)
replyMessage.SetBody(body)
requestBody.SetReplyMessage(replyMessage)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
replyWithQuote, err := graphClient.Chats().ByChatId("chat-id").Messages().ReplyWithQuote().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.chats.item.messages.replywithquote.ReplyWithQuotePostRequestBody replyWithQuotePostRequestBody = new com.microsoft.graph.beta.chats.item.messages.replywithquote.ReplyWithQuotePostRequestBody();
LinkedList<String> messageIds = new LinkedList<String>();
messageIds.add("1728088338580");
replyWithQuotePostRequestBody.setMessageIds(messageIds);
ChatMessage replyMessage = new ChatMessage();
ItemBody body = new ItemBody();
body.setContent("Hello World");
replyMessage.setBody(body);
replyWithQuotePostRequestBody.setReplyMessage(replyMessage);
var result = graphClient.chats().byChatId("{chat-id}").messages().replyWithQuote().post(replyWithQuotePostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const chatMessage = {
messageIds: [
'1728088338580'
],
replyMessage: {
body: {
content: 'Hello World'
}
}
};
await client.api('/chats/19:97641583cf154265a237da28ebbde27a@thread.v2/messages/replyWithQuote')
.version('beta')
.post(chatMessage);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Chats\Item\Messages\ReplyWithQuote\ReplyWithQuotePostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\ChatMessage;
use Microsoft\Graph\Beta\Generated\Models\ItemBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ReplyWithQuotePostRequestBody();
$requestBody->setMessageIds(['1728088338580', ]);
$replyMessage = new ChatMessage();
$replyMessageBody = new ItemBody();
$replyMessageBody->setContent('Hello World');
$replyMessage->setBody($replyMessageBody);
$requestBody->setReplyMessage($replyMessage);
$result = $graphServiceClient->chats()->byChatId('chat-id')->messages()->replyWithQuote()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
messageIds = @(
"1728088338580"
)
replyMessage = @{
body = @{
content = "Hello World"
}
}
}
Invoke-MgBetaGraphChatMessage -ChatId $chatId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.chats.item.messages.reply_with_quote.reply_with_quote_post_request_body import ReplyWithQuotePostRequestBody
from msgraph_beta.generated.models.chat_message import ChatMessage
from msgraph_beta.generated.models.item_body import ItemBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ReplyWithQuotePostRequestBody(
message_ids = [
"1728088338580",
],
reply_message = ChatMessage(
body = ItemBody(
content = "Hello World",
),
),
)
result = await graph_client.chats.by_chat_id('chat-id').messages.reply_with_quote.post(request_body)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#chats('19%3A97641583cf154265a237da28ebbde27a%40thread.v2')/messages/$entity",
"@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET chats('<key>')/messages('<key>')?$select=attachments,body",
"id": "1729091934196",
"replyToId": null,
"etag": "1729091934196",
"messageType": "message",
"createdDateTime": "2024-10-16T15:18:54.196Z",
"lastModifiedDateTime": "2024-10-16T15:18:54.196Z",
"lastEditedDateTime": null,
"deletedDateTime": null,
"subject": null,
"summary": null,
"chatId": "19:97641583cf154265a237da28ebbde27a@thread.v2",
"importance": "normal",
"locale": "en-us",
"webUrl": null,
"channelIdentity": null,
"policyViolation": null,
"eventDetail": null,
"from": {
"application": null,
"device": null,
"user": {
"@odata.type": "#microsoft.graph.teamworkUserIdentity",
"id": "28c10244-4bad-4fda-993c-f332faef94f0",
"displayName": "Adele Vance",
"userIdentityType": "aadUser",
"tenantId": "2432b57b-0abd-43db-aa7b-16eadd115d34"
}
},
"body": {
"contentType": "html",
"content": "<p></p>\n<attachment id=\"1728422677844\"></attachment>\ntest reply\n<p></p>"
},
"attachments": [
{
"id": "1728422677844",
"contentType": "messageReference",
"contentUrl": null,
"content": "{\"messageId\":\"1728422677844\",\"messagePreview\":\"Hello World Jane Smith\",\"messageSender\":{\"application\":null,\"device\":null,\"user\":{\"userIdentityType\":\"aadUser\",\"tenantId\":\"2432b57b-0abd-43db-aa7b-16eadd115d34\",\"id\":\"28c10244-4bad-4fda-993c-f332faef94f0\",\"displayName\":\"Adele Vance\"}}}",
"name": null,
"thumbnailUrl": null,
"teamsAppId": null
}
],
"mentions": [],
"reactions": []
}