Nature of the data in the body of an entity. Required.
Request body
In the request body, supply the values for relevant fields that should be updated. Existing properties that are not included in the request body will maintain their previous values or be recalculated based on changes to other property values. For best performance you shouldn't include existing values that haven't changed. The following properties can be updated.
Property
Type
Description
bccRecipients
Recipient
The Bcc recipients for the message.
body
ItemBody
The body of the message. Updatable only if isDraft = true.
The flag value that indicates the status, start date, due date, or completion date for the message.
from
Recipient
The mailbox owner and sender of the message. Must correspond to the actual mailbox used.
importance
String
The importance of the message. The possible values are: Low, Normal, High.
inferenceClassification
String
The classification of the message for the user, based on inferred relevance or importance, or on an explicit override. The possible values are: focused or other.
internetMessageId
String
The message ID in the format specified by RFC2822. Updatable only if isDraft = true.
isDeliveryReceiptRequested
Boolean
Indicates whether a read receipt is requested for the message.
isRead
Boolean
Indicates whether the message has been read.
isReadReceiptRequested
Boolean
Indicates whether a read receipt is requested for the message.
The collection of multi-value extended properties defined for the message. Nullable.
replyTo
Recipient collection
The email addresses to use when replying. Updatable only if isDraft = true.
sender
Recipient
The account that is actually used to generate the message. Updatable when sending a message from a shared mailbox, or sending a message as a delegate. In any case, the value must correspond to the actual mailbox used.
The collection of single-value extended properties defined for the message. Nullable.
subject
String
The subject of the message. Updatable only if isDraft = true.
toRecipients
Recipient collection
The To recipients for the message.
Since the message resource supports extensions, you can use the PATCH operation to
add, update, or delete your own app-specific data in custom properties of an extension in an existing message instance.
Response
If successful, this method returns a 200 OK response code and updated message object in the response body.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new Message
{
Subject = "subject-value",
Body = new ItemBody
{
ContentType = BodyType.Text,
Content = "content-value",
},
InferenceClassification = InferenceClassificationType.Other,
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.Messages["{message-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewMessage()
subject := "subject-value"
requestBody.SetSubject(&subject)
body := graphmodels.NewItemBody()
contentType := graphmodels.TEXT_BODYTYPE
body.SetContentType(&contentType)
content := "content-value"
body.SetContent(&content)
requestBody.SetBody(body)
inferenceClassification := graphmodels.OTHER_INFERENCECLASSIFICATIONTYPE
requestBody.SetInferenceClassification(&inferenceClassification)
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
messages, err := graphClient.Me().Messages().ByMessageId("message-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Message message = new Message();
message.setSubject("subject-value");
ItemBody body = new ItemBody();
body.setContentType(BodyType.Text);
body.setContent("content-value");
message.setBody(body);
message.setInferenceClassification(InferenceClassificationType.Other);
Message result = graphClient.me().messages().byMessageId("{message-id}").patch(message);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\Message;
use Microsoft\Graph\Generated\Models\ItemBody;
use Microsoft\Graph\Generated\Models\BodyType;
use Microsoft\Graph\Generated\Models\InferenceClassificationType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Message();
$requestBody->setSubject('subject-value');
$body = new ItemBody();
$body->setContentType(new BodyType('text'));
$body->setContent('content-value');
$requestBody->setBody($body);
$requestBody->setInferenceClassification(new InferenceClassificationType('other'));
$result = $graphServiceClient->me()->messages()->byMessageId('message-id')->patch($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.message import Message
from msgraph.generated.models.item_body import ItemBody
from msgraph.generated.models.body_type import BodyType
from msgraph.generated.models.inference_classification_type import InferenceClassificationType
# To initialize your graph_client, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Message(
subject = "subject-value",
body = ItemBody(
content_type = BodyType.Text,
content = "content-value",
),
inference_classification = InferenceClassificationType.Other,
)
result = await graph_client.me.messages.by_message_id('message-id').patch(request_body)