名前空間: microsoft.graph
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
JSON 形式または MIME 形式を使用して 、メッセージ のすべての受信者に返信します。
JSON 形式を使用する場合:
-
message パラメーターのコメントまたは body プロパティを指定します。 両方を指定すると、「HTTP 400 要求が正しくありません」というエラーが返されます。
- 元のメッセージで replyTo プロパティに受信者が指定されている場合は、インターネット メッセージ形式 (RFC 2822) に従って、from プロパティの受信者ではなく、replyTo の受信者に返信を送信します。
MIME 形式を使用すると、以下のことが可能になります。
このメソッドでは、[送信済みアイテム] フォルダーにメッセージを保存できます。
または、 メッセージに返信する下書きを作成し、後で 送信 します。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
✅ |
✅ |
✅ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
Mail.Send |
注意事項なし。 |
| 委任 (個人用 Microsoft アカウント) |
Mail.Send |
注意事項なし。 |
| アプリケーション |
Mail.Send |
注意事項なし。 |
HTTP 要求
POST /users/me/messages/{id}/replyAll
POST /users/{id | userPrincipalName}/messages/{id}/replyAll
POST /me/mailFolders/{id}/messages/{id}/replyAll
POST /users/{id | userPrincipalName}/mailFolders/{id}/messages/{id}/replyAll
| 名前 |
型 |
説明 |
| Authorization |
string |
ベアラー {token}。 必須 |
| Content-Type |
string |
エンティティ本文内のデータの性質です。 必須 JSON オブジェクトに application/json を使用し、MIME コンテンツに text/plain を使用する |
| 優先: outlook.timezone |
string |
この API が要求本文に基づいて作成する HTML の応答メッセージの Sent フィールドのタイム ゾーンを設定します。 値には、ユーザー用に構成 された supportedTimeZones のいずれかを指定できます。 指定しない場合、その Sent フィールドは UTC です。
このヘッダーは、 Content-Type: application/json ヘッダーを指定して HTML で応答メッセージを作成する場合にのみ使用します。
Content-Type: text/plain ヘッダーを使用する場合、このPrefer ヘッダーには影響しません。 省略可能。 |
要求本文
JSON オブジェクトを使用する場合、次のパラメーターを含む JSON オブジェクトを指定します。
| パラメーター |
型 |
説明 |
| comment |
String |
含めるコメントです。 空の文字列にすることができます。 |
| message |
message |
返信メッセージで更新する書き込み可能なプロパティです。 |
本文を MIME 形式で指定する場合は、該当するインターネット メッセージ ヘッダーを MIME コンテンツに指定します。すべて要求本文で base64 形式でエンコードされます。 このメソッドは、元のメッセージの送信者とすべての受信者を新しいメッセージの受信者として読み込みます。
応答
成功した場合、このメソッドは 202 Accepted 応答コードを返します。 応答本文では何も返されません。
要求本文に不正な MIME コンテンツが含まれていた場合、このメソッドは 400 Bad request と次のエラー メッセージを返します。"MIME コンテンツの無効な base64 文字列"。
例
次の例では、コメントを含め、添付ファイルを全員に返信メッセージに追加します。
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/beta/me/messages/AAMkADA1MTAAAH5JaKAAA=/replyAll
Content-Type: application/json
{
"message":{
"attachments": [
{
"@odata.type": "#microsoft.graph.fileAttachment",
"name": "guidelines.txt",
"contentBytes": "bWFjIGFuZCBjaGVlc2UgdG9kYXk="
}
]
},
"comment": "Please take a look at the attached guidelines before you decide on the name."
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Me.Messages.Item.ReplyAll;
using Microsoft.Graph.Beta.Models;
var requestBody = new ReplyAllPostRequestBody
{
Message = new Message
{
Attachments = new List<Attachment>
{
new FileAttachment
{
OdataType = "#microsoft.graph.fileAttachment",
Name = "guidelines.txt",
ContentBytes = Convert.FromBase64String("bWFjIGFuZCBjaGVlc2UgdG9kYXk="),
},
},
},
Comment = "Please take a look at the attached guidelines before you decide on the name.",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Me.Messages["{message-id}"].ReplyAll.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"
graphusers "github.com/microsoftgraph/msgraph-beta-sdk-go/users"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphusers.NewItemReplyAllPostRequestBody()
message := graphmodels.NewMessage()
attachment := graphmodels.NewFileAttachment()
name := "guidelines.txt"
attachment.SetName(&name)
contentBytes := []byte("bWFjIGFuZCBjaGVlc2UgdG9kYXk=")
attachment.SetContentBytes(&contentBytes)
attachments := []graphmodels.Attachmentable {
attachment,
}
message.SetAttachments(attachments)
requestBody.SetMessage(message)
comment := "Please take a look at the attached guidelines before you decide on the name."
requestBody.SetComment(&comment)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Me().Messages().ByMessageId("message-id").ReplyAll().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.users.item.messages.item.replyall.ReplyAllPostRequestBody replyAllPostRequestBody = new com.microsoft.graph.beta.users.item.messages.item.replyall.ReplyAllPostRequestBody();
Message message = new Message();
LinkedList<Attachment> attachments = new LinkedList<Attachment>();
FileAttachment attachment = new FileAttachment();
attachment.setOdataType("#microsoft.graph.fileAttachment");
attachment.setName("guidelines.txt");
byte[] contentBytes = Base64.getDecoder().decode("bWFjIGFuZCBjaGVlc2UgdG9kYXk=");
attachment.setContentBytes(contentBytes);
attachments.add(attachment);
message.setAttachments(attachments);
replyAllPostRequestBody.setMessage(message);
replyAllPostRequestBody.setComment("Please take a look at the attached guidelines before you decide on the name.");
graphClient.me().messages().byMessageId("{message-id}").replyAll().post(replyAllPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const replyAll = {
message: {
attachments: [
{
'@odata.type': '#microsoft.graph.fileAttachment',
name: 'guidelines.txt',
contentBytes: 'bWFjIGFuZCBjaGVlc2UgdG9kYXk='
}
]
},
comment: 'Please take a look at the attached guidelines before you decide on the name.'
};
await client.api('/me/messages/AAMkADA1MTAAAH5JaKAAA=/replyAll')
.version('beta')
.post(replyAll);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Users\Item\Messages\Item\ReplyAll\ReplyAllPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\Message;
use Microsoft\Graph\Beta\Generated\Models\Attachment;
use Microsoft\Graph\Beta\Generated\Models\FileAttachment;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ReplyAllPostRequestBody();
$message = new Message();
$attachmentsAttachment1 = new FileAttachment();
$attachmentsAttachment1->setOdataType('#microsoft.graph.fileAttachment');
$attachmentsAttachment1->setName('guidelines.txt');
$attachmentsAttachment1->setContentBytes(\GuzzleHttp\Psr7\Utils::streamFor(base64_decode('bWFjIGFuZCBjaGVlc2UgdG9kYXk=')));
$attachmentsArray []= $attachmentsAttachment1;
$message->setAttachments($attachmentsArray);
$requestBody->setMessage($message);
$requestBody->setComment('Please take a look at the attached guidelines before you decide on the name.');
$graphServiceClient->me()->messages()->byMessageId('message-id')->replyAll()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Mail
$params = @{
message = @{
attachments = @(
@{
"@odata.type" = "#microsoft.graph.fileAttachment"
name = "guidelines.txt"
contentBytes = "bWFjIGFuZCBjaGVlc2UgdG9kYXk="
}
)
}
comment = "Please take a look at the attached guidelines before you decide on the name."
}
# A UPN can also be used as -UserId.
Invoke-MgBetaReplyAllUserMessage -UserId $userId -MessageId $messageId -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.users.item.messages.item.reply_all.reply_all_post_request_body import ReplyAllPostRequestBody
from msgraph_beta.generated.models.message import Message
from msgraph_beta.generated.models.attachment import Attachment
from msgraph_beta.generated.models.file_attachment import FileAttachment
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ReplyAllPostRequestBody(
message = Message(
attachments = [
FileAttachment(
odata_type = "#microsoft.graph.fileAttachment",
name = "guidelines.txt",
content_bytes = base64.urlsafe_b64decode("bWFjIGFuZCBjaGVlc2UgdG9kYXk="),
),
],
),
comment = "Please take a look at the attached guidelines before you decide on the name.",
)
await graph_client.me.messages.by_message_id('message-id').reply_all.post(request_body)
応答
次の例は応答を示しています。
HTTP/1.1 202 Accepted
要求
POST https://graph.microsoft.com/beta/me/messages/AAMkADA1MTAAAH5JaLAAA=/replyAll
Content-Type: text/plain
RnJvbTogQWxleCBXaWxiZXIgPEFsZXhXQGNvbnRvc28uY29tPgpUbzogTWVnYW4gQm93ZW4gPE1l
Z2FuQkBjb250b3NvLmNvbT4KU3ViamVjdDogSW50ZXJuYWwgUmVzdW1lIFN1Ym1pc3Npb246IFNh
bGVzIEFzc29jaWF0ZQpUaHJlYWQtVG9waWM...
応答
次の例は応答を示しています。
HTTP/1.1 202 Accepted
要求本文に不正な MIME コンテンツが含まれていた場合、このメソッドは次のエラー メッセージを返します。
HTTP/1.1 400 Bad Request
Content-type: application/json
{
"error": {
"code": "ErrorMimeContentInvalidBase64String",
"message": "Invalid base64 string for MIME content."
}
}