Update chatMessage
- Article
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Update a chatMessage object.
You can update all the properties of chatMessage in delegated permissions scenarios, except for the policyViolation property and read-only properties. The policyViolation property is the only property that can be updated in application permissions scenarios.
Updating works only for chats where conversation members are Microsoft Teams users. If one of the members is using Skype, the operation fails.
This method does not support federation. Only the user in the tenant who sent the message can perform data loss prevention (DLP) updates on the specified chat message.
Note
When used with application permissions, this API is metered. It supports the model=A
payment model. For details, see Payment models. If you don't specify a payment model in your query, the default evaluation mode will be used.
This API is supported in the following national cloud deployments.
Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
---|---|---|---|
✅ | ✅ | ✅ | ✅ |
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permissions for channel
Permission type | Permissions (from least to most privileged) |
---|---|
Delegated (work or school account) | ChannelMessage.ReadWrite, Group.ReadWrite.All** |
Delegated (personal Microsoft account) | Not supported. |
Application | ChannelMessage.UpdatePolicyViolation.All, Group.ReadWrite.All** |
Note: Permissions marked with ** are supported only for backward compatibility. We recommend that you update your solutions to use an alternative permission listed in the previous table and avoid using these permissions going forward.
Permissions for chat
Permission type | Permissions (from least to most privileged) |
---|---|
Delegated (work or school account) | Chat.ReadWrite |
Delegated (personal Microsoft account) | Not supported. |
Application | Chat.UpdatePolicyViolation.All, Chat.ReadWrite.All |
HTTP request
To update a chatMessage in a channel:
PATCH /teams/(team-id)/channels/{channel-id}/messages/{message-id}
PATCH /teams/(team-id)/channels/{channel-id}/messages/{message-id}/replies/{reply-id}
To update a chatMessage in a chat:
PATCH /chats/{chatThread-id}/messages/{message-id}
Optional query parameters
You can use model
query parameter, which only supports the value A
, as shown in the following examples.
PATCH /teams/(team-id)/channels/{channel-id}/messages/{message-id}?model=A
PATCH /teams/(team-id)/channels/{channel-id}/messages/{message-id}/replies/{reply-id}?model=A
PATCH /chats/{chatThread-id}/messages/{message-id}?model=A
If no model
is specified, evaluation mode will be used.
Request headers
Name | Description |
---|---|
Authorization | Bearer {token}. Required. |
Content-Type | application/json. Required. |
Request body
For applications that use delegated permissions:
In the request body, supply a JSON representation of a chatMessage object, specifying the properties that need to be changed.
For applications that use application permissions:
In the request body, supply a JSON representation of a chatMessage object, specifying only the policyViolation property.
Response
For applications that use delegated permissions:
If successful, this method returns a 204 No Content
response.
For applications that use application permissions:
If successful, this method returns a 200 OK
response.
Errors
This API has licensing and payment requirements. If these requirements are not met, the API returns one of the following errors.
Sample error type | Status code | Sample error messages |
---|---|---|
E5 license requirement not met | 402 (Payment Required) | "...needs a valid license to access this API..." "...tenant needs a valid license to access this API..." |
Model B is not supported for API | 402 (Payment Required) | "...the 'model' query parameter does not support value 'B' for this API. Use billing model 'A'..." |
Evaluation capacity exceeded | 402 (Payment Required) | "...evaluation mode capacity has been exceeded. Use a valid billing model..." |
Examples
Example 1: Update policyViolation using application permissions
Request
The following is an example of the request to update the policyViolation property on a Microsoft Teams channel message by using application permissions.
PATCH https://graph.microsoft.com/beta/teams/e1234567-e123-4276-55555-6232b0e3a89a/channels/a7654321-e321-0000-0000-123b0e3a00a/messages/19%3Aa21b0b0c05194ebc9e30000000000f61%40thread.skype
Content-Type: application/json
{
"policyViolation": {
"policyTip": {
"generalText" : "This item has been blocked by the administrator.",
"complianceUrl" : "https://contoso.com/dlp-policy-page",
"matchedConditionDescriptions" : ["Credit Card Number"]
},
"verdictDetails" : "AllowOverrideWithoutJustification,AllowFalsePositiveOverride",
"dlpAction" : "BlockAccess"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new ChatMessage
{
PolicyViolation = new ChatMessagePolicyViolation
{
PolicyTip = new ChatMessagePolicyViolationPolicyTip
{
GeneralText = "This item has been blocked by the administrator.",
ComplianceUrl = "https://contoso.com/dlp-policy-page",
MatchedConditionDescriptions = new List<string>
{
"Credit Card Number",
},
},
VerdictDetails = ChatMessagePolicyViolationVerdictDetailsTypes.AllowOverrideWithoutJustification | ChatMessagePolicyViolationVerdictDetailsTypes.AllowFalsePositiveOverride,
DlpAction = ChatMessagePolicyViolationDlpActionTypes.BlockAccess,
},
};
var result = await graphClient.Teams["{team-id}"].Channels["{channel-id}"].Messages["{chatMessage-id}"].PatchAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta teams channels messages patch --team-id {team-id} --channel-id {channel-id} --chat-message-id {chatMessage-id} --body '{\
"policyViolation": {\
"policyTip": {\
"generalText" : "This item has been blocked by the administrator.",\
"complianceUrl" : "https://contoso.com/dlp-policy-page",\
"matchedConditionDescriptions" : ["Credit Card Number"]\
},\
"verdictDetails" : "AllowOverrideWithoutJustification,AllowFalsePositiveOverride",\
"dlpAction" : "BlockAccess"\
}\
}\
'
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewChatMessage()
policyViolation := graphmodels.NewChatMessagePolicyViolation()
policyTip := graphmodels.NewChatMessagePolicyViolationPolicyTip()
generalText := "This item has been blocked by the administrator."
policyTip.SetGeneralText(&generalText)
complianceUrl := "https://contoso.com/dlp-policy-page"
policyTip.SetComplianceUrl(&complianceUrl)
matchedConditionDescriptions := []string {
"Credit Card Number",
}
policyTip.SetMatchedConditionDescriptions(matchedConditionDescriptions)
policyViolation.SetPolicyTip(policyTip)
verdictDetails := graphmodels.ALLOWOVERRIDEWITHOUTJUSTIFICATION,ALLOWFALSEPOSITIVEOVERRIDE_CHATMESSAGEPOLICYVIOLATIONVERDICTDETAILSTYPES
policyViolation.SetVerdictDetails(&verdictDetails)
dlpAction := graphmodels.BLOCKACCESS_CHATMESSAGEPOLICYVIOLATIONDLPACTIONTYPES
policyViolation.SetDlpAction(&dlpAction)
requestBody.SetPolicyViolation(policyViolation)
messages, err := graphClient.Teams().ByTeamId("team-id").Channels().ByChannelId("channel-id").Messages().ByChatMessageId("chatMessage-id").Patch(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
ChatMessage chatMessage = new ChatMessage();
ChatMessagePolicyViolation policyViolation = new ChatMessagePolicyViolation();
ChatMessagePolicyViolationPolicyTip policyTip = new ChatMessagePolicyViolationPolicyTip();
policyTip.generalText = "This item has been blocked by the administrator.";
policyTip.complianceUrl = "https://contoso.com/dlp-policy-page";
LinkedList<String> matchedConditionDescriptionsList = new LinkedList<String>();
matchedConditionDescriptionsList.add("Credit Card Number");
policyTip.matchedConditionDescriptions = matchedConditionDescriptionsList;
policyViolation.policyTip = policyTip;
policyViolation.verdictDetails = EnumSet.of(ChatMessagePolicyViolationVerdictDetailsTypes.ALLOW_OVERRIDE_WITHOUT_JUSTIFICATION,ChatMessagePolicyViolationVerdictDetailsTypes.ALLOW_FALSE_POSITIVE_OVERRIDE);
policyViolation.dlpAction = EnumSet.of(ChatMessagePolicyViolationDlpActionTypes.BLOCK_ACCESS);
chatMessage.policyViolation = policyViolation;
graphClient.teams("e1234567-e123-4276-55555-6232b0e3a89a").channels("a7654321-e321-0000-0000-123b0e3a00a").messages("19:a21b0b0c05194ebc9e30000000000f61@thread.skype")
.buildRequest()
.patch(chatMessage);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
const chatMessage = {
policyViolation: {
policyTip: {
generalText: 'This item has been blocked by the administrator.',
complianceUrl: 'https://contoso.com/dlp-policy-page',
matchedConditionDescriptions: ['Credit Card Number']
},
verdictDetails: 'AllowOverrideWithoutJustification,AllowFalsePositiveOverride',
dlpAction: 'BlockAccess'
}
};
await client.api('/teams/e1234567-e123-4276-55555-6232b0e3a89a/channels/a7654321-e321-0000-0000-123b0e3a00a/messages/19:a21b0b0c05194ebc9e30000000000f61@thread.skype')
.version('beta')
.update(chatMessage);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ChatMessage();
$policyViolation = new ChatMessagePolicyViolation();
$policyViolationPolicyTip = new ChatMessagePolicyViolationPolicyTip();
$policyViolationPolicyTip->setGeneralText('This item has been blocked by the administrator.');
$policyViolationPolicyTip->setComplianceUrl('https://contoso.com/dlp-policy-page');
$policyViolationPolicyTip->setMatchedConditionDescriptions(['Credit Card Number', ]);
$policyViolation->setPolicyTip($policyViolationPolicyTip);
$policyViolation->setVerdictDetails(new ChatMessagePolicyViolationVerdictDetailsTypes('allowOverrideWithoutJustification,AllowFalsePositiveOverride'));
$policyViolation->setDlpAction(new ChatMessagePolicyViolationDlpActionTypes('blockAccess'));
$requestBody->setPolicyViolation($policyViolation);
$result = $graphServiceClient->teams()->byTeamId('team-id')->channels()->byChannelId('channel-id')->messages()->byChatMessageId('chatMessage-id')->patch($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
policyViolation = @{
policyTip = @{
generalText = "This item has been blocked by the administrator."
complianceUrl = "https://contoso.com/dlp-policy-page"
matchedConditionDescriptions = @(
"Credit Card Number"
)
}
verdictDetails = "AllowOverrideWithoutJustification,AllowFalsePositiveOverride"
dlpAction = "BlockAccess"
}
}
Update-MgBetaTeamChannelMessage -TeamId $teamId -ChannelId $channelId -ChatMessageId $chatMessageId -BodyParameter $params
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = ChatMessage(
policy_violation = ChatMessagePolicyViolation(
policy_tip = ChatMessagePolicyViolationPolicyTip(
general_text = "This item has been blocked by the administrator.",
compliance_url = "https://contoso.com/dlp-policy-page",
matched_condition_descriptions = [
"Credit Card Number",
]
),
verdict_details = ChatMessagePolicyViolationVerdictDetailsTypes.AllowOverrideWithoutJustification | ChatMessagePolicyViolationVerdictDetailsTypes.AllowFalsePositiveOverride,
dlp_action = ChatMessagePolicyViolationDlpActionTypes.BlockAccess,
),
)
result = await graph_client.teams.by_team_id('team-id').channels.by_channel_id('channel-id').messages.by_message_id('chatMessage-id').patch(body = request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
Here is an example of the response.
HTTP/1.1 200 OK
Example 2: Update any property of a message using delegated permissions
Request
The following is an example of the request to update the properties on a Microsoft Teams channel message by using delegated permissions.
PATCH https://graph.microsoft.com/beta/teams/e1234567-e123-4276-55555-6232b0e3a89a/channels/a7654321-e321-0000-0000-123b0e3a00a/messages/19%3Aa21b0b0c05194ebc9e30000000000f61%40thread.skype
Content-Type: application/json
{
"messageType": "message",
"subject": null,
"summary": null,
"importance": "normal",
"locale": "en-us",
"from": {
"application": null,
"device": null,
"user": {
"id": "3b102402-813e-4e17-a6b2-f841aef1fdfc",
"displayName": "Sumit Gupta",
"userIdentityType": "aadUser"
},
"conversation": null
},
"body": {
"contentType": "text",
"content": "Edit text only"
},
"attachments": [],
"mentions": [],
"reactions": [],
"messageHistory": []
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new ChatMessage
{
MessageType = ChatMessageType.Message,
Subject = null,
Summary = null,
Importance = ChatMessageImportance.Normal,
Locale = "en-us",
From = new ChatMessageFromIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "3b102402-813e-4e17-a6b2-f841aef1fdfc",
DisplayName = "Sumit Gupta",
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
AdditionalData = new Dictionary<string, object>
{
{
"conversation" , null
},
},
},
Body = new ItemBody
{
ContentType = BodyType.Text,
Content = "Edit text only",
},
Attachments = new List<ChatMessageAttachment>
{
},
Mentions = new List<ChatMessageMention>
{
},
Reactions = new List<ChatMessageReaction>
{
},
MessageHistory = new List<ChatMessageHistoryItem>
{
},
};
var result = await graphClient.Teams["{team-id}"].Channels["{channel-id}"].Messages["{chatMessage-id}"].PatchAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta teams channels messages patch --team-id {team-id} --channel-id {channel-id} --chat-message-id {chatMessage-id} --body '{\
"messageType": "message",\
"subject": null,\
"summary": null,\
"importance": "normal",\
"locale": "en-us",\
"from": {\
"application": null,\
"device": null,\
"user": {\
"id": "3b102402-813e-4e17-a6b2-f841aef1fdfc",\
"displayName": "Sumit Gupta",\
"userIdentityType": "aadUser"\
},\
"conversation": null\
},\
"body": {\
"contentType": "text",\
"content": "Edit text only"\
},\
"attachments": [],\
"mentions": [],\
"reactions": [],\
"messageHistory": []\
}\
'
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewChatMessage()
messageType := graphmodels.MESSAGE_CHATMESSAGETYPE
requestBody.SetMessageType(&messageType)
subject := null
requestBody.SetSubject(&subject)
summary := null
requestBody.SetSummary(&summary)
importance := graphmodels.NORMAL_CHATMESSAGEIMPORTANCE
requestBody.SetImportance(&importance)
locale := "en-us"
requestBody.SetLocale(&locale)
from := graphmodels.NewChatMessageFromIdentitySet()
application := null
from.SetApplication(&application)
device := null
from.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "3b102402-813e-4e17-a6b2-f841aef1fdfc"
user.SetId(&id)
displayName := "Sumit Gupta"
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
from.SetUser(user)
additionalData := map[string]interface{}{
conversation := null
from.SetConversation(&conversation)
}
from.SetAdditionalData(additionalData)
requestBody.SetFrom(from)
body := graphmodels.NewItemBody()
contentType := graphmodels.TEXT_BODYTYPE
body.SetContentType(&contentType)
content := "Edit text only"
body.SetContent(&content)
requestBody.SetBody(body)
attachments := []graphmodels.ChatMessageAttachmentable {
}
requestBody.SetAttachments(attachments)
mentions := []graphmodels.ChatMessageMentionable {
}
requestBody.SetMentions(mentions)
reactions := []graphmodels.ChatMessageReactionable {
}
requestBody.SetReactions(reactions)
messageHistory := []graphmodels.ChatMessageHistoryItemable {
}
requestBody.SetMessageHistory(messageHistory)
messages, err := graphClient.Teams().ByTeamId("team-id").Channels().ByChannelId("channel-id").Messages().ByChatMessageId("chatMessage-id").Patch(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
ChatMessage chatMessage = new ChatMessage();
chatMessage.messageType = ChatMessageType.MESSAGE;
chatMessage.subject = null;
chatMessage.summary = null;
chatMessage.importance = ChatMessageImportance.NORMAL;
chatMessage.locale = "en-us";
ChatMessageFromIdentitySet from = new ChatMessageFromIdentitySet();
from.application = null;
from.device = null;
Identity user = new Identity();
user.id = "3b102402-813e-4e17-a6b2-f841aef1fdfc";
user.displayName = "Sumit Gupta";
user.userIdentityType = TeamworkUserIdentityType.AAD_USER;
from.user = user;
from.conversation = null;
chatMessage.from = from;
ItemBody body = new ItemBody();
body.contentType = BodyType.TEXT;
body.content = "Edit text only";
chatMessage.body = body;
LinkedList<ChatMessageAttachment> attachmentsList = new LinkedList<ChatMessageAttachment>();
chatMessage.attachments = attachmentsList;
LinkedList<ChatMessageMention> mentionsList = new LinkedList<ChatMessageMention>();
chatMessage.mentions = mentionsList;
LinkedList<ChatMessageReaction> reactionsList = new LinkedList<ChatMessageReaction>();
chatMessage.reactions = reactionsList;
LinkedList<ChatMessageHistoryItem> messageHistoryList = new LinkedList<ChatMessageHistoryItem>();
chatMessage.messageHistory = messageHistoryList;
graphClient.teams("e1234567-e123-4276-55555-6232b0e3a89a").channels("a7654321-e321-0000-0000-123b0e3a00a").messages("19:a21b0b0c05194ebc9e30000000000f61@thread.skype")
.buildRequest()
.patch(chatMessage);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
const chatMessage = {
messageType: 'message',
subject: null,
summary: null,
importance: 'normal',
locale: 'en-us',
from: {
application: null,
device: null,
user: {
id: '3b102402-813e-4e17-a6b2-f841aef1fdfc',
displayName: 'Sumit Gupta',
userIdentityType: 'aadUser'
},
conversation: null
},
body: {
contentType: 'text',
content: 'Edit text only'
},
attachments: [],
mentions: [],
reactions: [],
messageHistory: []
};
await client.api('/teams/e1234567-e123-4276-55555-6232b0e3a89a/channels/a7654321-e321-0000-0000-123b0e3a00a/messages/19:a21b0b0c05194ebc9e30000000000f61@thread.skype')
.version('beta')
.update(chatMessage);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ChatMessage();
$requestBody->setMessageType(new ChatMessageType('message'));
$requestBody->setSubject(null);
$requestBody->setSummary(null);
$requestBody->setImportance(new ChatMessageImportance('normal'));
$requestBody->setLocale('en-us');
$from = new ChatMessageFromIdentitySet();
$from->setApplication(null);
$from->setDevice(null);
$fromUser = new Identity();
$fromUser->setId('3b102402-813e-4e17-a6b2-f841aef1fdfc');
$fromUser->setDisplayName('Sumit Gupta');
$additionalData = [
'userIdentityType' => 'aadUser',
];
$fromUser->setAdditionalData($additionalData);
$from->setUser($fromUser);
$additionalData = [
'conversation' => null,
];
$from->setAdditionalData($additionalData);
$requestBody->setFrom($from);
$body = new ItemBody();
$body->setContentType(new BodyType('text'));
$body->setContent('Edit text only');
$requestBody->setBody($body);
$requestBody->setAttachments([ ]);
$requestBody->setMentions([ ]);
$requestBody->setReactions([ ]);
$requestBody->setMessageHistory([ ]);
$result = $graphServiceClient->teams()->byTeamId('team-id')->channels()->byChannelId('channel-id')->messages()->byChatMessageId('chatMessage-id')->patch($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
messageType = "message"
subject = $null
summary = $null
importance = "normal"
locale = "en-us"
from = @{
application = $null
device = $null
user = @{
id = "3b102402-813e-4e17-a6b2-f841aef1fdfc"
displayName = "Sumit Gupta"
userIdentityType = "aadUser"
}
conversation = $null
}
body = @{
contentType = "text"
content = "Edit text only"
}
attachments = @(
)
mentions = @(
)
reactions = @(
)
messageHistory = @(
)
}
Update-MgBetaTeamChannelMessage -TeamId $teamId -ChannelId $channelId -ChatMessageId $chatMessageId -BodyParameter $params
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = ChatMessage(
message_type = ChatMessageType.Message,
subject = None,
summary = None,
importance = ChatMessageImportance.Normal,
locale = "en-us",
from = ChatMessageFromIdentitySet(
application = None,
device = None,
user = Identity(
id = "3b102402-813e-4e17-a6b2-f841aef1fdfc",
display_name = "Sumit Gupta",
additional_data = {
"user_identity_type" : "aadUser",
}
),
additional_data = {
"conversation" : None,
}
),
body = ItemBody(
content_type = BodyType.Text,
content = "Edit text only",
),
attachments = [
]
mentions = [
]
reactions = [
]
message_history = [
]
)
result = await graph_client.teams.by_team_id('team-id').channels.by_channel_id('channel-id').messages.by_message_id('chatMessage-id').patch(body = request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
Here is an example of the response.
HTTP/1.1 204 NoContent
Example 3: Update the mentions of a message using delegated permissions
Request
The following is an example of the request to update the mentions on a Microsoft Teams channel message by using delegated permissions.
PATCH https://graph.microsoft.com/beta/teams/e1234567-e123-4276-55555-6232b0e3a89a/channels/a7654321-e321-0000-0000-123b0e3a00a/messages/19%3Aa21b0b0c05194ebc9e30000000000f61%40thread.skype
Content-Type: application/json
{
"messageType": "message",
"deletedDateTime": null,
"subject": null,
"summary": null,
"importance": "normal",
"locale": "en-us",
"from": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "6b3f3c54-d09c-4fdd-b146-9b514a8a4f40",
"displayName": "Sumit Gupta",
"userIdentityType": "aadUser"
}
},
"body": {
"contentType": "html",
"content": "<div><div>\n<div>\n<div>\n<div>\n<div><at id=\"0\">Raghav</at><at id=\"1\">TestGlobalBot</at> YEAH"
},
"attachments": [],
"mentions": [
{
"id": 0,
"mentionText": "Raghav",
"mentioned": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "f1b66449-b46d-49b0-9c3c-53c10234c818e",
"displayName": "Raghav Mankad",
"userIdentityType": "aadUser"
}
}
},
{
"id": 1,
"mentionText": "TestGlobalBot",
"mentioned": {
"application": {
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
"displayName": "TestGlobalBot",
"applicationIdentityType": "bot"
},
"device": null,
"conversation": null,
"user": null
}
}
],
"reactions": [],
"messageHistory": []
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new ChatMessage
{
MessageType = ChatMessageType.Message,
DeletedDateTime = null,
Subject = null,
Summary = null,
Importance = ChatMessageImportance.Normal,
Locale = "en-us",
From = new ChatMessageFromIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "6b3f3c54-d09c-4fdd-b146-9b514a8a4f40",
DisplayName = "Sumit Gupta",
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
AdditionalData = new Dictionary<string, object>
{
{
"conversation" , null
},
},
},
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "<div><div>\n<div>\n<div>\n<div>\n<div><at id=\"0\">Raghav</at><at id=\"1\">TestGlobalBot</at> YEAH",
},
Attachments = new List<ChatMessageAttachment>
{
},
Mentions = new List<ChatMessageMention>
{
new ChatMessageMention
{
Id = 0,
MentionText = "Raghav",
Mentioned = new ChatMessageMentionedIdentitySet
{
Application = null,
Device = null,
Conversation = null,
User = new Identity
{
Id = "f1b66449-b46d-49b0-9c3c-53c10234c818e",
DisplayName = "Raghav Mankad",
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
new ChatMessageMention
{
Id = 1,
MentionText = "TestGlobalBot",
Mentioned = new ChatMessageMentionedIdentitySet
{
Application = new Identity
{
Id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
DisplayName = "TestGlobalBot",
AdditionalData = new Dictionary<string, object>
{
{
"applicationIdentityType" , "bot"
},
},
},
Device = null,
Conversation = null,
User = null,
},
},
},
Reactions = new List<ChatMessageReaction>
{
},
MessageHistory = new List<ChatMessageHistoryItem>
{
},
};
var result = await graphClient.Teams["{team-id}"].Channels["{channel-id}"].Messages["{chatMessage-id}"].PatchAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta teams channels messages patch --team-id {team-id} --channel-id {channel-id} --chat-message-id {chatMessage-id} --body '{\
"messageType": "message",\
"deletedDateTime": null,\
"subject": null,\
"summary": null,\
"importance": "normal",\
"locale": "en-us",\
"from": {\
"application": null,\
"device": null,\
"conversation": null,\
"user": {\
"id": "6b3f3c54-d09c-4fdd-b146-9b514a8a4f40",\
"displayName": "Sumit Gupta",\
"userIdentityType": "aadUser"\
}\
},\
"body": {\
"contentType": "html",\
"content": "<div><div>\n<div>\n<div>\n<div>\n<div><at id=\"0\">Raghav</at><at id=\"1\">TestGlobalBot</at> YEAH"\
},\
"attachments": [],\
"mentions": [\
{\
"id": 0,\
"mentionText": "Raghav",\
"mentioned": {\
"application": null,\
"device": null,\
"conversation": null,\
"user": {\
"id": "f1b66449-b46d-49b0-9c3c-53c10234c818e",\
"displayName": "Raghav Mankad",\
"userIdentityType": "aadUser"\
}\
}\
},\
{\
"id": 1,\
"mentionText": "TestGlobalBot",\
"mentioned": {\
"application": {\
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",\
"displayName": "TestGlobalBot",\
"applicationIdentityType": "bot"\
},\
"device": null,\
"conversation": null,\
"user": null\
}\
}\
],\
"reactions": [],\
"messageHistory": []\
}\
'
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewChatMessage()
messageType := graphmodels.MESSAGE_CHATMESSAGETYPE
requestBody.SetMessageType(&messageType)
deletedDateTime := null
requestBody.SetDeletedDateTime(&deletedDateTime)
subject := null
requestBody.SetSubject(&subject)
summary := null
requestBody.SetSummary(&summary)
importance := graphmodels.NORMAL_CHATMESSAGEIMPORTANCE
requestBody.SetImportance(&importance)
locale := "en-us"
requestBody.SetLocale(&locale)
from := graphmodels.NewChatMessageFromIdentitySet()
application := null
from.SetApplication(&application)
device := null
from.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "6b3f3c54-d09c-4fdd-b146-9b514a8a4f40"
user.SetId(&id)
displayName := "Sumit Gupta"
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
from.SetUser(user)
additionalData := map[string]interface{}{
conversation := null
from.SetConversation(&conversation)
}
from.SetAdditionalData(additionalData)
requestBody.SetFrom(from)
body := graphmodels.NewItemBody()
contentType := graphmodels.HTML_BODYTYPE
body.SetContentType(&contentType)
content := "<div><div>\n<div>\n<div>\n<div>\n<div><at id=\"0\">Raghav</at><at id=\"1\">TestGlobalBot</at> YEAH"
body.SetContent(&content)
requestBody.SetBody(body)
attachments := []graphmodels.ChatMessageAttachmentable {
}
requestBody.SetAttachments(attachments)
chatMessageMention := graphmodels.NewChatMessageMention()
id := int32(0)
chatMessageMention.SetId(&id)
mentionText := "Raghav"
chatMessageMention.SetMentionText(&mentionText)
mentioned := graphmodels.NewChatMessageMentionedIdentitySet()
application := null
mentioned.SetApplication(&application)
device := null
mentioned.SetDevice(&device)
conversation := null
mentioned.SetConversation(&conversation)
user := graphmodels.NewIdentity()
id := "f1b66449-b46d-49b0-9c3c-53c10234c818e"
user.SetId(&id)
displayName := "Raghav Mankad"
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
mentioned.SetUser(user)
chatMessageMention.SetMentioned(mentioned)
chatMessageMention1 := graphmodels.NewChatMessageMention()
id := int32(1)
chatMessageMention1.SetId(&id)
mentionText := "TestGlobalBot"
chatMessageMention1.SetMentionText(&mentionText)
mentioned := graphmodels.NewChatMessageMentionedIdentitySet()
application := graphmodels.NewIdentity()
id := "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
application.SetId(&id)
displayName := "TestGlobalBot"
application.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"applicationIdentityType" : "bot",
}
application.SetAdditionalData(additionalData)
mentioned.SetApplication(application)
device := null
mentioned.SetDevice(&device)
conversation := null
mentioned.SetConversation(&conversation)
user := null
mentioned.SetUser(&user)
chatMessageMention1.SetMentioned(mentioned)
mentions := []graphmodels.ChatMessageMentionable {
chatMessageMention,
chatMessageMention1,
}
requestBody.SetMentions(mentions)
reactions := []graphmodels.ChatMessageReactionable {
}
requestBody.SetReactions(reactions)
messageHistory := []graphmodels.ChatMessageHistoryItemable {
}
requestBody.SetMessageHistory(messageHistory)
messages, err := graphClient.Teams().ByTeamId("team-id").Channels().ByChannelId("channel-id").Messages().ByChatMessageId("chatMessage-id").Patch(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
ChatMessage chatMessage = new ChatMessage();
chatMessage.messageType = ChatMessageType.MESSAGE;
chatMessage.deletedDateTime = OffsetDateTimeSerializer.deserialize("null");
chatMessage.subject = null;
chatMessage.summary = null;
chatMessage.importance = ChatMessageImportance.NORMAL;
chatMessage.locale = "en-us";
ChatMessageFromIdentitySet from = new ChatMessageFromIdentitySet();
from.application = null;
from.device = null;
from.conversation = null;
Identity user = new Identity();
user.id = "6b3f3c54-d09c-4fdd-b146-9b514a8a4f40";
user.displayName = "Sumit Gupta";
user.userIdentityType = TeamworkUserIdentityType.AAD_USER;
from.user = user;
chatMessage.from = from;
ItemBody body = new ItemBody();
body.contentType = BodyType.HTML;
body.content = "<div><div>\n<div>\n<div>\n<div>\n<div><at id=\"0\">Raghav</at><at id=\"1\">TestGlobalBot</at> YEAH";
chatMessage.body = body;
LinkedList<ChatMessageAttachment> attachmentsList = new LinkedList<ChatMessageAttachment>();
chatMessage.attachments = attachmentsList;
LinkedList<ChatMessageMention> mentionsList = new LinkedList<ChatMessageMention>();
ChatMessageMention mentions = new ChatMessageMention();
mentions.id = 0;
mentions.mentionText = "Raghav";
ChatMessageMentionedIdentitySet mentioned = new ChatMessageMentionedIdentitySet();
mentioned.application = null;
mentioned.device = null;
mentioned.conversation = null;
Identity user1 = new Identity();
user1.id = "f1b66449-b46d-49b0-9c3c-53c10234c818e";
user1.displayName = "Raghav Mankad";
user1.userIdentityType = TeamworkUserIdentityType.AAD_USER;
mentioned.user = user1;
mentions.mentioned = mentioned;
mentionsList.add(mentions);
ChatMessageMention mentions1 = new ChatMessageMention();
mentions1.id = 1;
mentions1.mentionText = "TestGlobalBot";
ChatMessageMentionedIdentitySet mentioned1 = new ChatMessageMentionedIdentitySet();
Identity application2 = new Identity();
application2.id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e";
application2.displayName = "TestGlobalBot";
application2.applicationIdentityType = TeamworkApplicationIdentityType.BOT;
mentioned1.application = application2;
mentioned1.device = null;
mentioned1.conversation = null;
mentioned1.user = null;
mentions1.mentioned = mentioned1;
mentionsList.add(mentions1);
chatMessage.mentions = mentionsList;
LinkedList<ChatMessageReaction> reactionsList = new LinkedList<ChatMessageReaction>();
chatMessage.reactions = reactionsList;
LinkedList<ChatMessageHistoryItem> messageHistoryList = new LinkedList<ChatMessageHistoryItem>();
chatMessage.messageHistory = messageHistoryList;
graphClient.teams("e1234567-e123-4276-55555-6232b0e3a89a").channels("a7654321-e321-0000-0000-123b0e3a00a").messages("19:a21b0b0c05194ebc9e30000000000f61@thread.skype")
.buildRequest()
.patch(chatMessage);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
const chatMessage = {
messageType: 'message',
deletedDateTime: null,
subject: null,
summary: null,
importance: 'normal',
locale: 'en-us',
from: {
application: null,
device: null,
conversation: null,
user: {
id: '6b3f3c54-d09c-4fdd-b146-9b514a8a4f40',
displayName: 'Sumit Gupta',
userIdentityType: 'aadUser'
}
},
body: {
contentType: 'html',
content: '<div><div>\n<div>\n<div>\n<div>\n<div><at id=\"0\">Raghav</at><at id=\"1\">TestGlobalBot</at> YEAH'
},
attachments: [],
mentions: [
{
id: 0,
mentionText: 'Raghav',
mentioned: {
application: null,
device: null,
conversation: null,
user: {
id: 'f1b66449-b46d-49b0-9c3c-53c10234c818e',
displayName: 'Raghav Mankad',
userIdentityType: 'aadUser'
}
}
},
{
id: 1,
mentionText: 'TestGlobalBot',
mentioned: {
application: {
id: '03a02232-d8f5-4970-a77e-6e8c76ce7a4e',
displayName: 'TestGlobalBot',
applicationIdentityType: 'bot'
},
device: null,
conversation: null,
user: null
}
}
],
reactions: [],
messageHistory: []
};
await client.api('/teams/e1234567-e123-4276-55555-6232b0e3a89a/channels/a7654321-e321-0000-0000-123b0e3a00a/messages/19:a21b0b0c05194ebc9e30000000000f61@thread.skype')
.version('beta')
.update(chatMessage);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ChatMessage();
$requestBody->setMessageType(new ChatMessageType('message'));
$requestBody->setDeletedDateTime(null);
$requestBody->setSubject(null);
$requestBody->setSummary(null);
$requestBody->setImportance(new ChatMessageImportance('normal'));
$requestBody->setLocale('en-us');
$from = new ChatMessageFromIdentitySet();
$from->setApplication(null);
$from->setDevice(null);
$fromUser = new Identity();
$fromUser->setId('6b3f3c54-d09c-4fdd-b146-9b514a8a4f40');
$fromUser->setDisplayName('Sumit Gupta');
$additionalData = [
'userIdentityType' => 'aadUser',
];
$fromUser->setAdditionalData($additionalData);
$from->setUser($fromUser);
$additionalData = [
'conversation' => null,
];
$from->setAdditionalData($additionalData);
$requestBody->setFrom($from);
$body = new ItemBody();
$body->setContentType(new BodyType('html'));
$body->setContent('<div><div>\n<div>\n<div>\n<div>\n<div><at id=\"0\">Raghav</at><at id=\"1\">TestGlobalBot</at> YEAH');
$requestBody->setBody($body);
$requestBody->setAttachments([ ]);
$mentionsChatMessageMention1 = new ChatMessageMention();
$mentionsChatMessageMention1->setId(0);
$mentionsChatMessageMention1->setMentionText('Raghav');
$mentionsChatMessageMention1Mentioned = new ChatMessageMentionedIdentitySet();
$mentionsChatMessageMention1Mentioned->setApplication(null);
$mentionsChatMessageMention1Mentioned->setDevice(null);
$mentionsChatMessageMention1Mentioned->setConversation(null);
$mentionsChatMessageMention1MentionedUser = new Identity();
$mentionsChatMessageMention1MentionedUser->setId('f1b66449-b46d-49b0-9c3c-53c10234c818e');
$mentionsChatMessageMention1MentionedUser->setDisplayName('Raghav Mankad');
$additionalData = [
'userIdentityType' => 'aadUser',
];
$mentionsChatMessageMention1MentionedUser->setAdditionalData($additionalData);
$mentionsChatMessageMention1Mentioned->setUser($mentionsChatMessageMention1MentionedUser);
$mentionsChatMessageMention1->setMentioned($mentionsChatMessageMention1Mentioned);
$mentionsArray []= $mentionsChatMessageMention1;
$mentionsChatMessageMention2 = new ChatMessageMention();
$mentionsChatMessageMention2->setId(1);
$mentionsChatMessageMention2->setMentionText('TestGlobalBot');
$mentionsChatMessageMention2Mentioned = new ChatMessageMentionedIdentitySet();
$mentionsChatMessageMention2MentionedApplication = new Identity();
$mentionsChatMessageMention2MentionedApplication->setId('03a02232-d8f5-4970-a77e-6e8c76ce7a4e');
$mentionsChatMessageMention2MentionedApplication->setDisplayName('TestGlobalBot');
$additionalData = [
'applicationIdentityType' => 'bot',
];
$mentionsChatMessageMention2MentionedApplication->setAdditionalData($additionalData);
$mentionsChatMessageMention2Mentioned->setApplication($mentionsChatMessageMention2MentionedApplication);
$mentionsChatMessageMention2Mentioned->setDevice(null);
$mentionsChatMessageMention2Mentioned->setConversation(null);
$mentionsChatMessageMention2Mentioned->setUser(null);
$mentionsChatMessageMention2->setMentioned($mentionsChatMessageMention2Mentioned);
$mentionsArray []= $mentionsChatMessageMention2;
$requestBody->setMentions($mentionsArray);
$requestBody->setReactions([]);
$requestBody->setMessageHistory([]);
$result = $graphServiceClient->teams()->byTeamId('team-id')->channels()->byChannelId('channel-id')->messages()->byChatMessageId('chatMessage-id')->patch($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
messageType = "message"
deletedDateTime = $null
subject = $null
summary = $null
importance = "normal"
locale = "en-us"
from = @{
application = $null
device = $null
conversation = $null
user = @{
id = "6b3f3c54-d09c-4fdd-b146-9b514a8a4f40"
displayName = "Sumit Gupta"
userIdentityType = "aadUser"
}
}
body = @{
contentType = "html"
content = "<div><div>
<div>
<div>
<div>
<div><at id="0">Raghav</at><at id="1">TestGlobalBot</at> YEAH"
}
attachments = @(
)
mentions = @(
@{
id = 0
mentionText = "Raghav"
mentioned = @{
application = $null
device = $null
conversation = $null
user = @{
id = "f1b66449-b46d-49b0-9c3c-53c10234c818e"
displayName = "Raghav Mankad"
userIdentityType = "aadUser"
}
}
}
@{
id = 1
mentionText = "TestGlobalBot"
mentioned = @{
application = @{
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
displayName = "TestGlobalBot"
applicationIdentityType = "bot"
}
device = $null
conversation = $null
user = $null
}
}
)
reactions = @(
)
messageHistory = @(
)
}
Update-MgBetaTeamChannelMessage -TeamId $teamId -ChannelId $channelId -ChatMessageId $chatMessageId -BodyParameter $params
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = ChatMessage(
message_type = ChatMessageType.Message,
deleted_date_time = None,
subject = None,
summary = None,
importance = ChatMessageImportance.Normal,
locale = "en-us",
from = ChatMessageFromIdentitySet(
application = None,
device = None,
user = Identity(
id = "6b3f3c54-d09c-4fdd-b146-9b514a8a4f40",
display_name = "Sumit Gupta",
additional_data = {
"user_identity_type" : "aadUser",
}
),
additional_data = {
"conversation" : None,
}
),
body = ItemBody(
content_type = BodyType.Html,
content = "<div><div>\n<div>\n<div>\n<div>\n<div><at id=\"0\">Raghav</at><at id=\"1\">TestGlobalBot</at> YEAH",
),
attachments = [
]
mentions = [
ChatMessageMention(
id = 0,
mention_text = "Raghav",
mentioned = ChatMessageMentionedIdentitySet(
application = None,
device = None,
conversation = None,
user = Identity(
id = "f1b66449-b46d-49b0-9c3c-53c10234c818e",
display_name = "Raghav Mankad",
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
ChatMessageMention(
id = 1,
mention_text = "TestGlobalBot",
mentioned = ChatMessageMentionedIdentitySet(
application = Identity(
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
display_name = "TestGlobalBot",
additional_data = {
"application_identity_type" : "bot",
}
),
device = None,
conversation = None,
user = None,
),
),
]
reactions = [
]
message_history = [
]
)
result = await graph_client.teams.by_team_id('team-id').channels.by_channel_id('channel-id').messages.by_message_id('chatMessage-id').patch(body = request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
Here is an example of the response.
HTTP/1.1 204 NoContent
Example 4: Update the content with attachments of a message using delegated permissions
Request
The following is an example of the request to update the attachments on a Microsoft Teams channel message by using delegated permissions.
PATCH https://graph.microsoft.com/beta/teams/e1234567-e123-4276-55555-6232b0e3a89a/channels/a7654321-e321-0000-0000-123b0e3a00a/messages/19%3Aa21b0b0c05194ebc9e30000000000f61%40thread.skype
Content-Type: application/json
{
"messageType": "message",
"subject": null,
"summary": null,
"importance": "normal",
"locale": "en-us",
"from": {
"application": null,
"device": null,
"user": {
"id": "3b102402-813e-4e17-a6b2-f841aef1fdfc",
"displayName": "Sumit Gupta",
"userIdentityType": "aadUser"
},
"conversation": null
},
"body": {
"contentType": "html",
"content": "<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>"
},
"attachments": [
{
"id": "e8f78756199240b88448ae0fc6db112d",
"contentType": "application/vnd.microsoft.card.hero",
"contentUrl": null,
"content": "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"openUrl\",\r\n \"image\": \"https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\": \"😃😃 click me 😃😃\",\r\n \"value\": \"http://microsoft.com\"\r\n },\r\n {\r\n \"type\": \"imback\",\r\n \"title\": \"&i am back& <>= \\\"\",\r\n \"value\": \"&i am back& <>= \\\"\"\r\n },\r\n {\r\n \"type\": \"openUrl\",\r\n \"title\": \"Open URL\",\r\n \"value\": \"http://google.com\"\r\n }\r\n ]\r\n}",
"name": null,
"thumbnailUrl": null
},
{
"id": "638464e32834471ea202007da60a5ae6",
"contentType": "application/vnd.microsoft.card.hero",
"contentUrl": null,
"content": "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"messageBack\",\r\n \"title\": \"&message back& <>= \\\"\",\r\n \"text\": \"text = &message back& <>= \\\"\",\r\n \"displayText\": \"displayText = &message back& <>= \\\"\",\r\n \"value\": {\r\n \"text\": \"some text 2\"\r\n }\r\n }\r\n ]\r\n}",
"name": null,
"thumbnailUrl": null
}
],
"mentions": [],
"reactions": [],
"messageHistory": []
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new ChatMessage
{
MessageType = ChatMessageType.Message,
Subject = null,
Summary = null,
Importance = ChatMessageImportance.Normal,
Locale = "en-us",
From = new ChatMessageFromIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "3b102402-813e-4e17-a6b2-f841aef1fdfc",
DisplayName = "Sumit Gupta",
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
AdditionalData = new Dictionary<string, object>
{
{
"conversation" , null
},
},
},
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>",
},
Attachments = new List<ChatMessageAttachment>
{
new ChatMessageAttachment
{
Id = "e8f78756199240b88448ae0fc6db112d",
ContentType = "application/vnd.microsoft.card.hero",
ContentUrl = null,
Content = "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"openUrl\",\r\n \"image\": \"https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\": \"😃😃 click me 😃😃\",\r\n \"value\": \"http://microsoft.com\"\r\n },\r\n {\r\n \"type\": \"imback\",\r\n \"title\": \"&i am back& <>= \"\",\r\n \"value\": \"&i am back& <>= \"\"\r\n },\r\n {\r\n \"type\": \"openUrl\",\r\n \"title\": \"Open URL\",\r\n \"value\": \"http://google.com\"\r\n }\r\n ]\r\n}",
Name = null,
ThumbnailUrl = null,
},
new ChatMessageAttachment
{
Id = "638464e32834471ea202007da60a5ae6",
ContentType = "application/vnd.microsoft.card.hero",
ContentUrl = null,
Content = "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"messageBack\",\r\n \"title\": \"&message back& <>= \"\",\r\n \"text\": \"text = &message back& <>= \"\",\r\n \"displayText\": \"displayText = &message back& <>= \"\",\r\n \"value\": {\r\n \"text\": \"some text 2\"\r\n }\r\n }\r\n ]\r\n}",
Name = null,
ThumbnailUrl = null,
},
},
Mentions = new List<ChatMessageMention>
{
},
Reactions = new List<ChatMessageReaction>
{
},
MessageHistory = new List<ChatMessageHistoryItem>
{
},
};
var result = await graphClient.Teams["{team-id}"].Channels["{channel-id}"].Messages["{chatMessage-id}"].PatchAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta teams channels messages patch --team-id {team-id} --channel-id {channel-id} --chat-message-id {chatMessage-id} --body '{\
"messageType": "message",\
"subject": null,\
"summary": null,\
"importance": "normal",\
"locale": "en-us",\
"from": {\
"application": null,\
"device": null,\
"user": {\
"id": "3b102402-813e-4e17-a6b2-f841aef1fdfc",\
"displayName": "Sumit Gupta",\
"userIdentityType": "aadUser"\
},\
"conversation": null\
},\
"body": {\
"contentType": "html",\
"content": "<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>"\
},\
"attachments": [\
{\
"id": "e8f78756199240b88448ae0fc6db112d",\
"contentType": "application/vnd.microsoft.card.hero",\
"contentUrl": null,\
"content": "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"openUrl\",\r\n \"image\": \"https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\": \"😃😃 click me 😃😃\",\r\n \"value\": \"http://microsoft.com\"\r\n },\r\n {\r\n \"type\": \"imback\",\r\n \"title\": \"&i am back& <>= \\\"\",\r\n \"value\": \"&i am back& <>= \\\"\"\r\n },\r\n {\r\n \"type\": \"openUrl\",\r\n \"title\": \"Open URL\",\r\n \"value\": \"http://google.com\"\r\n }\r\n ]\r\n}",\
"name": null,\
"thumbnailUrl": null\
},\
{\
"id": "638464e32834471ea202007da60a5ae6",\
"contentType": "application/vnd.microsoft.card.hero",\
"contentUrl": null,\
"content": "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"messageBack\",\r\n \"title\": \"&message back& <>= \\\"\",\r\n \"text\": \"text = &message back& <>= \\\"\",\r\n \"displayText\": \"displayText = &message back& <>= \\\"\",\r\n \"value\": {\r\n \"text\": \"some text 2\"\r\n }\r\n }\r\n ]\r\n}",\
"name": null,\
"thumbnailUrl": null\
}\
],\
"mentions": [],\
"reactions": [],\
"messageHistory": []\
}\
'
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewChatMessage()
messageType := graphmodels.MESSAGE_CHATMESSAGETYPE
requestBody.SetMessageType(&messageType)
subject := null
requestBody.SetSubject(&subject)
summary := null
requestBody.SetSummary(&summary)
importance := graphmodels.NORMAL_CHATMESSAGEIMPORTANCE
requestBody.SetImportance(&importance)
locale := "en-us"
requestBody.SetLocale(&locale)
from := graphmodels.NewChatMessageFromIdentitySet()
application := null
from.SetApplication(&application)
device := null
from.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "3b102402-813e-4e17-a6b2-f841aef1fdfc"
user.SetId(&id)
displayName := "Sumit Gupta"
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
from.SetUser(user)
additionalData := map[string]interface{}{
conversation := null
from.SetConversation(&conversation)
}
from.SetAdditionalData(additionalData)
requestBody.SetFrom(from)
body := graphmodels.NewItemBody()
contentType := graphmodels.HTML_BODYTYPE
body.SetContentType(&contentType)
content := "<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>"
body.SetContent(&content)
requestBody.SetBody(body)
chatMessageAttachment := graphmodels.NewChatMessageAttachment()
id := "e8f78756199240b88448ae0fc6db112d"
chatMessageAttachment.SetId(&id)
contentType := "application/vnd.microsoft.card.hero"
chatMessageAttachment.SetContentType(&contentType)
contentUrl := null
chatMessageAttachment.SetContentUrl(&contentUrl)
content := "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"openUrl\",\r\n \"image\": \"https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\": \"😃😃 click me 😃😃\",\r\n \"value\": \"http://microsoft.com\"\r\n },\r\n {\r\n \"type\": \"imback\",\r\n \"title\": \"&i am back& <>= \"\",\r\n \"value\": \"&i am back& <>= \"\"\r\n },\r\n {\r\n \"type\": \"openUrl\",\r\n \"title\": \"Open URL\",\r\n \"value\": \"http://google.com\"\r\n }\r\n ]\r\n}"
chatMessageAttachment.SetContent(&content)
name := null
chatMessageAttachment.SetName(&name)
thumbnailUrl := null
chatMessageAttachment.SetThumbnailUrl(&thumbnailUrl)
chatMessageAttachment1 := graphmodels.NewChatMessageAttachment()
id := "638464e32834471ea202007da60a5ae6"
chatMessageAttachment1.SetId(&id)
contentType := "application/vnd.microsoft.card.hero"
chatMessageAttachment1.SetContentType(&contentType)
contentUrl := null
chatMessageAttachment1.SetContentUrl(&contentUrl)
content := "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"messageBack\",\r\n \"title\": \"&message back& <>= \"\",\r\n \"text\": \"text = &message back& <>= \"\",\r\n \"displayText\": \"displayText = &message back& <>= \"\",\r\n \"value\": {\r\n \"text\": \"some text 2\"\r\n }\r\n }\r\n ]\r\n}"
chatMessageAttachment1.SetContent(&content)
name := null
chatMessageAttachment1.SetName(&name)
thumbnailUrl := null
chatMessageAttachment1.SetThumbnailUrl(&thumbnailUrl)
attachments := []graphmodels.ChatMessageAttachmentable {
chatMessageAttachment,
chatMessageAttachment1,
}
requestBody.SetAttachments(attachments)
mentions := []graphmodels.ChatMessageMentionable {
}
requestBody.SetMentions(mentions)
reactions := []graphmodels.ChatMessageReactionable {
}
requestBody.SetReactions(reactions)
messageHistory := []graphmodels.ChatMessageHistoryItemable {
}
requestBody.SetMessageHistory(messageHistory)
messages, err := graphClient.Teams().ByTeamId("team-id").Channels().ByChannelId("channel-id").Messages().ByChatMessageId("chatMessage-id").Patch(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
ChatMessage chatMessage = new ChatMessage();
chatMessage.messageType = ChatMessageType.MESSAGE;
chatMessage.subject = null;
chatMessage.summary = null;
chatMessage.importance = ChatMessageImportance.NORMAL;
chatMessage.locale = "en-us";
ChatMessageFromIdentitySet from = new ChatMessageFromIdentitySet();
from.application = null;
from.device = null;
Identity user = new Identity();
user.id = "3b102402-813e-4e17-a6b2-f841aef1fdfc";
user.displayName = "Sumit Gupta";
user.userIdentityType = TeamworkUserIdentityType.AAD_USER;
from.user = user;
from.conversation = null;
chatMessage.from = from;
ItemBody body = new ItemBody();
body.contentType = BodyType.HTML;
body.content = "<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>";
chatMessage.body = body;
LinkedList<ChatMessageAttachment> attachmentsList = new LinkedList<ChatMessageAttachment>();
ChatMessageAttachment attachments = new ChatMessageAttachment();
attachments.id = "e8f78756199240b88448ae0fc6db112d";
attachments.contentType = "application/vnd.microsoft.card.hero";
attachments.contentUrl = null;
attachments.content = "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"openUrl\",\r\n \"image\": \"https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\": \"😃😃 click me 😃😃\",\r\n \"value\": \"http://microsoft.com\"\r\n },\r\n {\r\n \"type\": \"imback\",\r\n \"title\": \"&i am back& <>= \\\"\",\r\n \"value\": \"&i am back& <>= \\\"\"\r\n },\r\n {\r\n \"type\": \"openUrl\",\r\n \"title\": \"Open URL\",\r\n \"value\": \"http://google.com\"\r\n }\r\n ]\r\n}";
attachments.name = null;
attachments.thumbnailUrl = null;
attachmentsList.add(attachments);
ChatMessageAttachment attachments1 = new ChatMessageAttachment();
attachments1.id = "638464e32834471ea202007da60a5ae6";
attachments1.contentType = "application/vnd.microsoft.card.hero";
attachments1.contentUrl = null;
attachments1.content = "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"messageBack\",\r\n \"title\": \"&message back& <>= \\\"\",\r\n \"text\": \"text = &message back& <>= \\\"\",\r\n \"displayText\": \"displayText = &message back& <>= \\\"\",\r\n \"value\": {\r\n \"text\": \"some text 2\"\r\n }\r\n }\r\n ]\r\n}";
attachments1.name = null;
attachments1.thumbnailUrl = null;
attachmentsList.add(attachments1);
chatMessage.attachments = attachmentsList;
LinkedList<ChatMessageMention> mentionsList = new LinkedList<ChatMessageMention>();
chatMessage.mentions = mentionsList;
LinkedList<ChatMessageReaction> reactionsList = new LinkedList<ChatMessageReaction>();
chatMessage.reactions = reactionsList;
LinkedList<ChatMessageHistoryItem> messageHistoryList = new LinkedList<ChatMessageHistoryItem>();
chatMessage.messageHistory = messageHistoryList;
graphClient.teams("e1234567-e123-4276-55555-6232b0e3a89a").channels("a7654321-e321-0000-0000-123b0e3a00a").messages("19:a21b0b0c05194ebc9e30000000000f61@thread.skype")
.buildRequest()
.patch(chatMessage);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
const chatMessage = {
messageType: 'message',
subject: null,
summary: null,
importance: 'normal',
locale: 'en-us',
from: {
application: null,
device: null,
user: {
id: '3b102402-813e-4e17-a6b2-f841aef1fdfc',
displayName: 'Sumit Gupta',
userIdentityType: 'aadUser'
},
conversation: null
},
body: {
contentType: 'html',
content: '<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>'
},
attachments: [
{
id: 'e8f78756199240b88448ae0fc6db112d',
contentType: 'application/vnd.microsoft.card.hero',
contentUrl: null,
content: '{\r\n \"title\': \'*title*\",\r\n \"subtitle\': \'*subtitle*\",\r\n \"text\': \'Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you\'re cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\': [\r\n {\r\n \'url\': \'https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\': [\r\n {\r\n \'type\': \'openUrl\",\r\n \"image\': \'https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\': \'😃😃 click me 😃😃\",\r\n \"value\': \'http://microsoft.com\"\r\n },\r\n {\r\n \"type\': \'imback\",\r\n \"title\': \'&i am back& <>= \\\"\",\r\n \"value\': \'&i am back& <>= \\\"\"\r\n },\r\n {\r\n \"type\': \'openUrl\",\r\n \"title\': \'Open URL\",\r\n \"value\': \"http://google.com\"\r\n }\r\n ]\r\n}",
name: null,
thumbnailUrl: null
},
{
id: '638464e32834471ea202007da60a5ae6',
contentType: 'application/vnd.microsoft.card.hero',
contentUrl: null,
content: '{\r\n \"title\': \'*title*\",\r\n \"subtitle\': \'*subtitle*\",\r\n \"text\': \'Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you\'re cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\': [\r\n {\r\n \'url\': \'https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\': [\r\n {\r\n \'type\': \'messageBack\",\r\n \"title\': \'&message back& <>= \\\"\",\r\n \"text\': \'text = &message back& <>= \\\"\",\r\n \"displayText\': \'displayText = &message back& <>= \\\"\",\r\n \"value\': {\r\n \'text\': \"some text 2\"\r\n }\r\n }\r\n ]\r\n}",
name: null,
thumbnailUrl: null
}
],
mentions: [],
reactions: [],
messageHistory: []
};
await client.api('/teams/e1234567-e123-4276-55555-6232b0e3a89a/channels/a7654321-e321-0000-0000-123b0e3a00a/messages/19:a21b0b0c05194ebc9e30000000000f61@thread.skype')
.version('beta')
.update(chatMessage);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ChatMessage();
$requestBody->setMessageType(new ChatMessageType('message'));
$requestBody->setSubject(null);
$requestBody->setSummary(null);
$requestBody->setImportance(new ChatMessageImportance('normal'));
$requestBody->setLocale('en-us');
$from = new ChatMessageFromIdentitySet();
$from->setApplication(null);
$from->setDevice(null);
$fromUser = new Identity();
$fromUser->setId('3b102402-813e-4e17-a6b2-f841aef1fdfc');
$fromUser->setDisplayName('Sumit Gupta');
$additionalData = [
'userIdentityType' => 'aadUser',
];
$fromUser->setAdditionalData($additionalData);
$from->setUser($fromUser);
$additionalData = [
'conversation' => null,
];
$from->setAdditionalData($additionalData);
$requestBody->setFrom($from);
$body = new ItemBody();
$body->setContentType(new BodyType('html'));
$body->setContent('<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>');
$requestBody->setBody($body);
$attachmentsChatMessageAttachment1 = new ChatMessageAttachment();
$attachmentsChatMessageAttachment1->setId('e8f78756199240b88448ae0fc6db112d');
$attachmentsChatMessageAttachment1->setContentType('application/vnd.microsoft.card.hero');
$attachmentsChatMessageAttachment1->setContentUrl(null);
$attachmentsChatMessageAttachment1->setContent('{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you\'re cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"openUrl\",\r\n \"image\": \"https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\": \"😃😃 click me 😃😃\",\r\n \"value\": \"http://microsoft.com\"\r\n },\r\n {\r\n \"type\": \"imback\",\r\n \"title\": \"&i am back& <>= \"\",\r\n \"value\": \"&i am back& <>= \"\"\r\n },\r\n {\r\n \"type\": \"openUrl\",\r\n \"title\": \"Open URL\",\r\n \"value\": \"http://google.com\"\r\n }\r\n ]\r\n}');
$attachmentsChatMessageAttachment1->setName(null);
$attachmentsChatMessageAttachment1->setThumbnailUrl(null);
$attachmentsArray []= $attachmentsChatMessageAttachment1;
$attachmentsChatMessageAttachment2 = new ChatMessageAttachment();
$attachmentsChatMessageAttachment2->setId('638464e32834471ea202007da60a5ae6');
$attachmentsChatMessageAttachment2->setContentType('application/vnd.microsoft.card.hero');
$attachmentsChatMessageAttachment2->setContentUrl(null);
$attachmentsChatMessageAttachment2->setContent('{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you\'re cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"messageBack\",\r\n \"title\": \"&message back& <>= \"\",\r\n \"text\": \"text = &message back& <>= \"\",\r\n \"displayText\": \"displayText = &message back& <>= \"\",\r\n \"value\": {\r\n \"text\": \"some text 2\"\r\n }\r\n }\r\n ]\r\n}');
$attachmentsChatMessageAttachment2->setName(null);
$attachmentsChatMessageAttachment2->setThumbnailUrl(null);
$attachmentsArray []= $attachmentsChatMessageAttachment2;
$requestBody->setAttachments($attachmentsArray);
$requestBody->setMentions([]);
$requestBody->setReactions([]);
$requestBody->setMessageHistory([]);
$result = $graphServiceClient->teams()->byTeamId('team-id')->channels()->byChannelId('channel-id')->messages()->byChatMessageId('chatMessage-id')->patch($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
messageType = "message"
subject = $null
summary = $null
importance = "normal"
locale = "en-us"
from = @{
application = $null
device = $null
user = @{
id = "3b102402-813e-4e17-a6b2-f841aef1fdfc"
displayName = "Sumit Gupta"
userIdentityType = "aadUser"
}
conversation = $null
}
body = @{
contentType = "html"
content = "<p><em>text</em></p><attachment id="e8f78756199240b88448ae0fc6db112d"></attachment><attachment id="638464e32834471ea202007da60a5ae6"></attachment>"
}
attachments = @(
@{
id = "e8f78756199240b88448ae0fc6db112d"
contentType = "application/vnd.microsoft.card.hero"
contentUrl = $null
content = '{
"title": "*title*",
"subtitle": "*subtitle*",
"text": "Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.",
"images": [
{
"url": "https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview"
}
],
"buttons": [
{
"type": "openUrl",
"image": "https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png",
"title": "😃😃 click me 😃😃",
"value": "http://microsoft.com"
},
{
"type": "imback",
"title": "&i am back& <>= \"",
"value": "&i am back& <>= \""
},
{
"type": "openUrl",
"title": "Open URL",
"value": "http://google.com"
}
]
}'
name = $null
thumbnailUrl = $null
}
@{
id = "638464e32834471ea202007da60a5ae6"
contentType = "application/vnd.microsoft.card.hero"
contentUrl = $null
content = '{
"title": "*title*",
"subtitle": "*subtitle*",
"text": "Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.",
"images": [
{
"url": "https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview"
}
],
"buttons": [
{
"type": "messageBack",
"title": "&message back& <>= \"",
"text": "text = &message back& <>= \"",
"displayText": "displayText = &message back& <>= \"",
"value": {
"text": "some text 2"
}
}
]
}'
name = $null
thumbnailUrl = $null
}
)
mentions = @(
)
reactions = @(
)
messageHistory = @(
)
}
Update-MgBetaTeamChannelMessage -TeamId $teamId -ChannelId $channelId -ChatMessageId $chatMessageId -BodyParameter $params
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = ChatMessage(
message_type = ChatMessageType.Message,
subject = None,
summary = None,
importance = ChatMessageImportance.Normal,
locale = "en-us",
from = ChatMessageFromIdentitySet(
application = None,
device = None,
user = Identity(
id = "3b102402-813e-4e17-a6b2-f841aef1fdfc",
display_name = "Sumit Gupta",
additional_data = {
"user_identity_type" : "aadUser",
}
),
additional_data = {
"conversation" : None,
}
),
body = ItemBody(
content_type = BodyType.Html,
content = "<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>",
),
attachments = [
ChatMessageAttachment(
id = "e8f78756199240b88448ae0fc6db112d",
content_type = "application/vnd.microsoft.card.hero",
content_url = None,
content = "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"openUrl\",\r\n \"image\": \"https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\": \"😃😃 click me 😃😃\",\r\n \"value\": \"http://microsoft.com\"\r\n },\r\n {\r\n \"type\": \"imback\",\r\n \"title\": \"&i am back& <>= \"\",\r\n \"value\": \"&i am back& <>= \"\"\r\n },\r\n {\r\n \"type\": \"openUrl\",\r\n \"title\": \"Open URL\",\r\n \"value\": \"http://google.com\"\r\n }\r\n ]\r\n}",
name = None,
thumbnail_url = None,
),
ChatMessageAttachment(
id = "638464e32834471ea202007da60a5ae6",
content_type = "application/vnd.microsoft.card.hero",
content_url = None,
content = "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"messageBack\",\r\n \"title\": \"&message back& <>= \"\",\r\n \"text\": \"text = &message back& <>= \"\",\r\n \"displayText\": \"displayText = &message back& <>= \"\",\r\n \"value\": {\r\n \"text\": \"some text 2\"\r\n }\r\n }\r\n ]\r\n}",
name = None,
thumbnail_url = None,
),
]
mentions = [
]
reactions = [
]
message_history = [
]
)
result = await graph_client.teams.by_team_id('team-id').channels.by_channel_id('channel-id').messages.by_message_id('chatMessage-id').patch(body = request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
Here is an example of the response.
HTTP/1.1 204 NoContent
Example 5: Update the reactions in a message using delegated permissions
Request
The following is an example of the request to update the reactions property on a Microsoft Teams channel message by using delegated permissions.
PATCH https://graph.microsoft.com/beta/teams/e1234567-e123-4276-55555-6232b0e3a89a/channels/a7654321-e321-0000-0000-123b0e3a00a/messages/19%3Aa21b0b0c05194ebc9e30000000000f61%40thread.skype
Content-Type: application/json
{
"messageType": "message",
"subject": null,
"summary": null,
"importance": "normal",
"locale": "en-us",
"from": {
"application": null,
"device": null,
"user": {
"id": "3b102402-813e-4e17-a6b2-f841aef1fdfc",
"displayName": "Sumit Gupta",
"userIdentityType": "aadUser"
},
"conversation": null
},
"body": {
"contentType": "html",
"content": "<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>"
},
"attachments": [
{
"id": "e8f78756199240b88448ae0fc6db112d",
"contentType": "application/vnd.microsoft.card.hero",
"contentUrl": null,
"content": "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"openUrl\",\r\n \"image\": \"https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\": \"😃😃 click me 😃😃\",\r\n \"value\": \"http://microsoft.com\"\r\n },\r\n {\r\n \"type\": \"imback\",\r\n \"title\": \"&i am back& <>= \\\"\",\r\n \"value\": \"&i am back& <>= \\\"\"\r\n },\r\n {\r\n \"type\": \"openUrl\",\r\n \"title\": \"Open URL\",\r\n \"value\": \"http://google.com\"\r\n }\r\n ]\r\n}",
"name": null,
"thumbnailUrl": null
},
{
"id": "638464e32834471ea202007da60a5ae6",
"contentType": "application/vnd.microsoft.card.hero",
"contentUrl": null,
"content": "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"messageBack\",\r\n \"title\": \"&message back& <>= \\\"\",\r\n \"text\": \"text = &message back& <>= \\\"\",\r\n \"displayText\": \"displayText = &message back& <>= \\\"\",\r\n \"value\": {\r\n \"text\": \"some text 2\"\r\n }\r\n }\r\n ]\r\n}",
"name": null,
"thumbnailUrl": null
}
],
"mentions": [],
"reactions": [
{
"reactionType": "angry",
"createdDateTime": "2018-10-21T08:10:30.489Z",
"user": {
"application": null,
"device": null,
"user": {
"id": "f1b66449-b46d-49b0-9c3c-53c10a5c818e",
"displayName": null,
"userIdentityType": "aadUser"
}
}
},
{
"reactionType": "laugh",
"createdDateTime": "2018-10-21T08:10:32.489Z",
"user": {
"application": null,
"device": null,
"user": {
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
"displayName": null,
"userIdentityType": "aadUser"
}
}
},
{
"reactionType": "like",
"createdDateTime": "2018-10-21T02:17:14.67Z",
"user": {
"application": null,
"device": null,
"user": {
"id": "f1b66449-b46d-49b0-9c3c-53c10a5c818e",
"displayName": null,
"userIdentityType": "aadUser"
}
}
},
{
"reactionType": "like",
"createdDateTime": "2018-10-21T02:34:40.3Z",
"user": {
"application": null,
"device": null,
"user": {
"id": "4c9041b7-449a-40f7-8855-56da239b9fd1",
"displayName": null,
"userIdentityType": "aadUser"
}
}
},
{
"reactionType": "like",
"createdDateTime": "2018-10-21T08:10:25.489Z",
"user": {
"application": null,
"device": null,
"user": {
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
"displayName": null,
"userIdentityType": "aadUser"
}
}
},
{
"reactionType": "heart",
"createdDateTime": "2018-10-21T08:10:31.489Z",
"user": {
"application": null,
"device": null,
"user": {
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
"displayName": null,
"userIdentityType": "aadUser"
}
}
},
{
"reactionType": "sad",
"createdDateTime": "2018-10-21T08:10:33.489Z",
"user": {
"application": null,
"device": null,
"user": {
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
"displayName": null,
"userIdentityType": "aadUser"
}
}
},
{
"reactionType": "surprised",
"createdDateTime": "2018-10-21T08:10:34.489Z",
"user": {
"application": null,
"device": null,
"user": {
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
"displayName": null,
"userIdentityType": "aadUser"
}
}
}
],
"messageHistory": [
{
"modifiedDateTime": "2018-10-21T08:10:30.489Z",
"actions": "reactionAdded",
"reaction": {
"reactionType": "angry",
"user": {
"application": null,
"device": null,
"user": {
"id": "f1b66449-b46d-49b0-9c3c-53c10a5c818e",
"displayName": null,
"userIdentityType": "aadUser"
}
}
}
},
{
"modifiedDateTime": "2018-10-21T08:10:32.489Z",
"actions": "reactionAdded",
"reaction": {
"reactionType": "laugh",
"user": {
"application": null,
"device": null,
"user": {
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
"displayName": null,
"userIdentityType": "aadUser"
}
}
}
},
{
"modifiedDateTime": "2018-10-21T02:17:14.67Z",
"actions": "reactionAdded",
"reaction": {
"reactionType": "like",
"user": {
"application": null,
"device": null,
"user": {
"id": "f1b66449-b46d-49b0-9c3c-53c10a5c818e",
"displayName": null,
"userIdentityType": "aadUser"
}
}
}
},
{
"modifiedDateTime": "2018-10-21T02:34:40.3Z",
"actions": "reactionAdded",
"reaction": {
"reactionType": "like",
"user": {
"application": null,
"device": null,
"user": {
"id": "4c9041b7-449a-40f7-8855-56da239b9fd1",
"displayName": null,
"userIdentityType": "aadUser"
}
}
}
},
{
"modifiedDateTime": "2018-10-21T08:10:25.489Z",
"actions": "reactionAdded",
"reaction": {
"reactionType": "like",
"user": {
"application": null,
"device": null,
"user": {
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
"displayName": null,
"userIdentityType": "aadUser"
}
}
}
},
{
"modifiedDateTime": "2018-10-21T08:10:31.489Z",
"actions": "reactionAdded",
"reaction": {
"reactionType": "heart",
"user": {
"application": null,
"device": null,
"user": {
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
"displayName": null,
"userIdentityType": "aadUser"
}
}
}
},
{
"modifiedDateTime": "2018-10-21T08:10:33.489Z",
"actions": "reactionAdded",
"reaction": {
"reactionType": "sad",
"user": {
"application": null,
"device": null,
"user": {
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
"displayName": null,
"userIdentityType": "aadUser"
}
}
}
},
{
"modifiedDateTime": "2018-10-21T08:10:34.489Z",
"actions": "surprised",
"reaction": {
"reactionType": "sad",
"user": {
"application": null,
"device": null,
"user": {
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
"displayName": null,
"userIdentityType": "aadUser"
}
}
}
}
]
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new ChatMessage
{
MessageType = ChatMessageType.Message,
Subject = null,
Summary = null,
Importance = ChatMessageImportance.Normal,
Locale = "en-us",
From = new ChatMessageFromIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "3b102402-813e-4e17-a6b2-f841aef1fdfc",
DisplayName = "Sumit Gupta",
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
AdditionalData = new Dictionary<string, object>
{
{
"conversation" , null
},
},
},
Body = new ItemBody
{
ContentType = BodyType.Html,
Content = "<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>",
},
Attachments = new List<ChatMessageAttachment>
{
new ChatMessageAttachment
{
Id = "e8f78756199240b88448ae0fc6db112d",
ContentType = "application/vnd.microsoft.card.hero",
ContentUrl = null,
Content = "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"openUrl\",\r\n \"image\": \"https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\": \"😃😃 click me 😃😃\",\r\n \"value\": \"http://microsoft.com\"\r\n },\r\n {\r\n \"type\": \"imback\",\r\n \"title\": \"&i am back& <>= \"\",\r\n \"value\": \"&i am back& <>= \"\"\r\n },\r\n {\r\n \"type\": \"openUrl\",\r\n \"title\": \"Open URL\",\r\n \"value\": \"http://google.com\"\r\n }\r\n ]\r\n}",
Name = null,
ThumbnailUrl = null,
},
new ChatMessageAttachment
{
Id = "638464e32834471ea202007da60a5ae6",
ContentType = "application/vnd.microsoft.card.hero",
ContentUrl = null,
Content = "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"messageBack\",\r\n \"title\": \"&message back& <>= \"\",\r\n \"text\": \"text = &message back& <>= \"\",\r\n \"displayText\": \"displayText = &message back& <>= \"\",\r\n \"value\": {\r\n \"text\": \"some text 2\"\r\n }\r\n }\r\n ]\r\n}",
Name = null,
ThumbnailUrl = null,
},
},
Mentions = new List<ChatMessageMention>
{
},
Reactions = new List<ChatMessageReaction>
{
new ChatMessageReaction
{
ReactionType = "angry",
CreatedDateTime = DateTimeOffset.Parse("2018-10-21T08:10:30.489Z"),
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
new ChatMessageReaction
{
ReactionType = "laugh",
CreatedDateTime = DateTimeOffset.Parse("2018-10-21T08:10:32.489Z"),
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
new ChatMessageReaction
{
ReactionType = "like",
CreatedDateTime = DateTimeOffset.Parse("2018-10-21T02:17:14.67Z"),
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
new ChatMessageReaction
{
ReactionType = "like",
CreatedDateTime = DateTimeOffset.Parse("2018-10-21T02:34:40.3Z"),
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "4c9041b7-449a-40f7-8855-56da239b9fd1",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
new ChatMessageReaction
{
ReactionType = "like",
CreatedDateTime = DateTimeOffset.Parse("2018-10-21T08:10:25.489Z"),
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
new ChatMessageReaction
{
ReactionType = "heart",
CreatedDateTime = DateTimeOffset.Parse("2018-10-21T08:10:31.489Z"),
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
new ChatMessageReaction
{
ReactionType = "sad",
CreatedDateTime = DateTimeOffset.Parse("2018-10-21T08:10:33.489Z"),
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
new ChatMessageReaction
{
ReactionType = "surprised",
CreatedDateTime = DateTimeOffset.Parse("2018-10-21T08:10:34.489Z"),
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
},
MessageHistory = new List<ChatMessageHistoryItem>
{
new ChatMessageHistoryItem
{
ModifiedDateTime = DateTimeOffset.Parse("2018-10-21T08:10:30.489Z"),
Actions = ChatMessageActions.ReactionAdded,
Reaction = new ChatMessageReaction
{
ReactionType = "angry",
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
},
new ChatMessageHistoryItem
{
ModifiedDateTime = DateTimeOffset.Parse("2018-10-21T08:10:32.489Z"),
Actions = ChatMessageActions.ReactionAdded,
Reaction = new ChatMessageReaction
{
ReactionType = "laugh",
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
},
new ChatMessageHistoryItem
{
ModifiedDateTime = DateTimeOffset.Parse("2018-10-21T02:17:14.67Z"),
Actions = ChatMessageActions.ReactionAdded,
Reaction = new ChatMessageReaction
{
ReactionType = "like",
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
},
new ChatMessageHistoryItem
{
ModifiedDateTime = DateTimeOffset.Parse("2018-10-21T02:34:40.3Z"),
Actions = ChatMessageActions.ReactionAdded,
Reaction = new ChatMessageReaction
{
ReactionType = "like",
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "4c9041b7-449a-40f7-8855-56da239b9fd1",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
},
new ChatMessageHistoryItem
{
ModifiedDateTime = DateTimeOffset.Parse("2018-10-21T08:10:25.489Z"),
Actions = ChatMessageActions.ReactionAdded,
Reaction = new ChatMessageReaction
{
ReactionType = "like",
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
},
new ChatMessageHistoryItem
{
ModifiedDateTime = DateTimeOffset.Parse("2018-10-21T08:10:31.489Z"),
Actions = ChatMessageActions.ReactionAdded,
Reaction = new ChatMessageReaction
{
ReactionType = "heart",
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
},
new ChatMessageHistoryItem
{
ModifiedDateTime = DateTimeOffset.Parse("2018-10-21T08:10:33.489Z"),
Actions = ChatMessageActions.ReactionAdded,
Reaction = new ChatMessageReaction
{
ReactionType = "sad",
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
},
new ChatMessageHistoryItem
{
ModifiedDateTime = DateTimeOffset.Parse("2018-10-21T08:10:34.489Z"),
Actions = ChatMessageActions.ReactionAdded,
Reaction = new ChatMessageReaction
{
ReactionType = "sad",
User = new ChatMessageReactionIdentitySet
{
Application = null,
Device = null,
User = new Identity
{
Id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
DisplayName = null,
AdditionalData = new Dictionary<string, object>
{
{
"userIdentityType" , "aadUser"
},
},
},
},
},
},
},
};
var result = await graphClient.Teams["{team-id}"].Channels["{channel-id}"].Messages["{chatMessage-id}"].PatchAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta teams channels messages patch --team-id {team-id} --channel-id {channel-id} --chat-message-id {chatMessage-id} --body '{\
"messageType": "message",\
"subject": null,\
"summary": null,\
"importance": "normal",\
"locale": "en-us",\
"from": {\
"application": null,\
"device": null,\
"user": {\
"id": "3b102402-813e-4e17-a6b2-f841aef1fdfc",\
"displayName": "Sumit Gupta",\
"userIdentityType": "aadUser"\
},\
"conversation": null\
},\
"body": {\
"contentType": "html",\
"content": "<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>"\
},\
"attachments": [\
{\
"id": "e8f78756199240b88448ae0fc6db112d",\
"contentType": "application/vnd.microsoft.card.hero",\
"contentUrl": null,\
"content": "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"openUrl\",\r\n \"image\": \"https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\": \"😃😃 click me 😃😃\",\r\n \"value\": \"http://microsoft.com\"\r\n },\r\n {\r\n \"type\": \"imback\",\r\n \"title\": \"&i am back& <>= \\\"\",\r\n \"value\": \"&i am back& <>= \\\"\"\r\n },\r\n {\r\n \"type\": \"openUrl\",\r\n \"title\": \"Open URL\",\r\n \"value\": \"http://google.com\"\r\n }\r\n ]\r\n}",\
"name": null,\
"thumbnailUrl": null\
},\
{\
"id": "638464e32834471ea202007da60a5ae6",\
"contentType": "application/vnd.microsoft.card.hero",\
"contentUrl": null,\
"content": "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"messageBack\",\r\n \"title\": \"&message back& <>= \\\"\",\r\n \"text\": \"text = &message back& <>= \\\"\",\r\n \"displayText\": \"displayText = &message back& <>= \\\"\",\r\n \"value\": {\r\n \"text\": \"some text 2\"\r\n }\r\n }\r\n ]\r\n}",\
"name": null,\
"thumbnailUrl": null\
}\
],\
"mentions": [],\
"reactions": [\
{\
"reactionType": "angry",\
"createdDateTime": "2018-10-21T08:10:30.489Z",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "f1b66449-b46d-49b0-9c3c-53c10a5c818e",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
},\
{\
"reactionType": "laugh",\
"createdDateTime": "2018-10-21T08:10:32.489Z",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
},\
{\
"reactionType": "like",\
"createdDateTime": "2018-10-21T02:17:14.67Z",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "f1b66449-b46d-49b0-9c3c-53c10a5c818e",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
},\
{\
"reactionType": "like",\
"createdDateTime": "2018-10-21T02:34:40.3Z",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "4c9041b7-449a-40f7-8855-56da239b9fd1",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
},\
{\
"reactionType": "like",\
"createdDateTime": "2018-10-21T08:10:25.489Z",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
},\
{\
"reactionType": "heart",\
"createdDateTime": "2018-10-21T08:10:31.489Z",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
},\
{\
"reactionType": "sad",\
"createdDateTime": "2018-10-21T08:10:33.489Z",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
},\
{\
"reactionType": "surprised",\
"createdDateTime": "2018-10-21T08:10:34.489Z",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
}\
],\
"messageHistory": [\
{\
"modifiedDateTime": "2018-10-21T08:10:30.489Z",\
"actions": "reactionAdded",\
"reaction": {\
"reactionType": "angry",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "f1b66449-b46d-49b0-9c3c-53c10a5c818e",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
}\
},\
{\
"modifiedDateTime": "2018-10-21T08:10:32.489Z",\
"actions": "reactionAdded",\
"reaction": {\
"reactionType": "laugh",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
}\
},\
{\
"modifiedDateTime": "2018-10-21T02:17:14.67Z",\
"actions": "reactionAdded",\
"reaction": {\
"reactionType": "like",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "f1b66449-b46d-49b0-9c3c-53c10a5c818e",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
}\
},\
{\
"modifiedDateTime": "2018-10-21T02:34:40.3Z",\
"actions": "reactionAdded",\
"reaction": {\
"reactionType": "like",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "4c9041b7-449a-40f7-8855-56da239b9fd1",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
}\
},\
{\
"modifiedDateTime": "2018-10-21T08:10:25.489Z",\
"actions": "reactionAdded",\
"reaction": {\
"reactionType": "like",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
}\
},\
{\
"modifiedDateTime": "2018-10-21T08:10:31.489Z",\
"actions": "reactionAdded",\
"reaction": {\
"reactionType": "heart",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
}\
},\
{\
"modifiedDateTime": "2018-10-21T08:10:33.489Z",\
"actions": "reactionAdded",\
"reaction": {\
"reactionType": "sad",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
}\
},\
{\
"modifiedDateTime": "2018-10-21T08:10:34.489Z",\
"actions": "surprised",\
"reaction": {\
"reactionType": "sad",\
"user": {\
"application": null,\
"device": null,\
"user": {\
"id": "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",\
"displayName": null,\
"userIdentityType": "aadUser"\
}\
}\
}\
}\
]\
}\
'
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewChatMessage()
messageType := graphmodels.MESSAGE_CHATMESSAGETYPE
requestBody.SetMessageType(&messageType)
subject := null
requestBody.SetSubject(&subject)
summary := null
requestBody.SetSummary(&summary)
importance := graphmodels.NORMAL_CHATMESSAGEIMPORTANCE
requestBody.SetImportance(&importance)
locale := "en-us"
requestBody.SetLocale(&locale)
from := graphmodels.NewChatMessageFromIdentitySet()
application := null
from.SetApplication(&application)
device := null
from.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "3b102402-813e-4e17-a6b2-f841aef1fdfc"
user.SetId(&id)
displayName := "Sumit Gupta"
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
from.SetUser(user)
additionalData := map[string]interface{}{
conversation := null
from.SetConversation(&conversation)
}
from.SetAdditionalData(additionalData)
requestBody.SetFrom(from)
body := graphmodels.NewItemBody()
contentType := graphmodels.HTML_BODYTYPE
body.SetContentType(&contentType)
content := "<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>"
body.SetContent(&content)
requestBody.SetBody(body)
chatMessageAttachment := graphmodels.NewChatMessageAttachment()
id := "e8f78756199240b88448ae0fc6db112d"
chatMessageAttachment.SetId(&id)
contentType := "application/vnd.microsoft.card.hero"
chatMessageAttachment.SetContentType(&contentType)
contentUrl := null
chatMessageAttachment.SetContentUrl(&contentUrl)
content := "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"openUrl\",\r\n \"image\": \"https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\": \"😃😃 click me 😃😃\",\r\n \"value\": \"http://microsoft.com\"\r\n },\r\n {\r\n \"type\": \"imback\",\r\n \"title\": \"&i am back& <>= \"\",\r\n \"value\": \"&i am back& <>= \"\"\r\n },\r\n {\r\n \"type\": \"openUrl\",\r\n \"title\": \"Open URL\",\r\n \"value\": \"http://google.com\"\r\n }\r\n ]\r\n}"
chatMessageAttachment.SetContent(&content)
name := null
chatMessageAttachment.SetName(&name)
thumbnailUrl := null
chatMessageAttachment.SetThumbnailUrl(&thumbnailUrl)
chatMessageAttachment1 := graphmodels.NewChatMessageAttachment()
id := "638464e32834471ea202007da60a5ae6"
chatMessageAttachment1.SetId(&id)
contentType := "application/vnd.microsoft.card.hero"
chatMessageAttachment1.SetContentType(&contentType)
contentUrl := null
chatMessageAttachment1.SetContentUrl(&contentUrl)
content := "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"messageBack\",\r\n \"title\": \"&message back& <>= \"\",\r\n \"text\": \"text = &message back& <>= \"\",\r\n \"displayText\": \"displayText = &message back& <>= \"\",\r\n \"value\": {\r\n \"text\": \"some text 2\"\r\n }\r\n }\r\n ]\r\n}"
chatMessageAttachment1.SetContent(&content)
name := null
chatMessageAttachment1.SetName(&name)
thumbnailUrl := null
chatMessageAttachment1.SetThumbnailUrl(&thumbnailUrl)
attachments := []graphmodels.ChatMessageAttachmentable {
chatMessageAttachment,
chatMessageAttachment1,
}
requestBody.SetAttachments(attachments)
mentions := []graphmodels.ChatMessageMentionable {
}
requestBody.SetMentions(mentions)
chatMessageReaction := graphmodels.NewChatMessageReaction()
reactionType := "angry"
chatMessageReaction.SetReactionType(&reactionType)
createdDateTime , err := time.Parse(time.RFC3339, "2018-10-21T08:10:30.489Z")
chatMessageReaction.SetCreatedDateTime(&createdDateTime)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "f1b66449-b46d-49b0-9c3c-53c10a5c818e"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
chatMessageReaction.SetUser(user)
chatMessageReaction1 := graphmodels.NewChatMessageReaction()
reactionType := "laugh"
chatMessageReaction1.SetReactionType(&reactionType)
createdDateTime , err := time.Parse(time.RFC3339, "2018-10-21T08:10:32.489Z")
chatMessageReaction1.SetCreatedDateTime(&createdDateTime)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
chatMessageReaction1.SetUser(user)
chatMessageReaction2 := graphmodels.NewChatMessageReaction()
reactionType := "like"
chatMessageReaction2.SetReactionType(&reactionType)
createdDateTime , err := time.Parse(time.RFC3339, "2018-10-21T02:17:14.67Z")
chatMessageReaction2.SetCreatedDateTime(&createdDateTime)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "f1b66449-b46d-49b0-9c3c-53c10a5c818e"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
chatMessageReaction2.SetUser(user)
chatMessageReaction3 := graphmodels.NewChatMessageReaction()
reactionType := "like"
chatMessageReaction3.SetReactionType(&reactionType)
createdDateTime , err := time.Parse(time.RFC3339, "2018-10-21T02:34:40.3Z")
chatMessageReaction3.SetCreatedDateTime(&createdDateTime)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "4c9041b7-449a-40f7-8855-56da239b9fd1"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
chatMessageReaction3.SetUser(user)
chatMessageReaction4 := graphmodels.NewChatMessageReaction()
reactionType := "like"
chatMessageReaction4.SetReactionType(&reactionType)
createdDateTime , err := time.Parse(time.RFC3339, "2018-10-21T08:10:25.489Z")
chatMessageReaction4.SetCreatedDateTime(&createdDateTime)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
chatMessageReaction4.SetUser(user)
chatMessageReaction5 := graphmodels.NewChatMessageReaction()
reactionType := "heart"
chatMessageReaction5.SetReactionType(&reactionType)
createdDateTime , err := time.Parse(time.RFC3339, "2018-10-21T08:10:31.489Z")
chatMessageReaction5.SetCreatedDateTime(&createdDateTime)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
chatMessageReaction5.SetUser(user)
chatMessageReaction6 := graphmodels.NewChatMessageReaction()
reactionType := "sad"
chatMessageReaction6.SetReactionType(&reactionType)
createdDateTime , err := time.Parse(time.RFC3339, "2018-10-21T08:10:33.489Z")
chatMessageReaction6.SetCreatedDateTime(&createdDateTime)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
chatMessageReaction6.SetUser(user)
chatMessageReaction7 := graphmodels.NewChatMessageReaction()
reactionType := "surprised"
chatMessageReaction7.SetReactionType(&reactionType)
createdDateTime , err := time.Parse(time.RFC3339, "2018-10-21T08:10:34.489Z")
chatMessageReaction7.SetCreatedDateTime(&createdDateTime)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
chatMessageReaction7.SetUser(user)
reactions := []graphmodels.ChatMessageReactionable {
chatMessageReaction,
chatMessageReaction1,
chatMessageReaction2,
chatMessageReaction3,
chatMessageReaction4,
chatMessageReaction5,
chatMessageReaction6,
chatMessageReaction7,
}
requestBody.SetReactions(reactions)
chatMessageHistoryItem := graphmodels.NewChatMessageHistoryItem()
modifiedDateTime , err := time.Parse(time.RFC3339, "2018-10-21T08:10:30.489Z")
chatMessageHistoryItem.SetModifiedDateTime(&modifiedDateTime)
actions := graphmodels.REACTIONADDED_CHATMESSAGEACTIONS
chatMessageHistoryItem.SetActions(&actions)
reaction := graphmodels.NewChatMessageReaction()
reactionType := "angry"
reaction.SetReactionType(&reactionType)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "f1b66449-b46d-49b0-9c3c-53c10a5c818e"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
reaction.SetUser(user)
chatMessageHistoryItem.SetReaction(reaction)
chatMessageHistoryItem1 := graphmodels.NewChatMessageHistoryItem()
modifiedDateTime , err := time.Parse(time.RFC3339, "2018-10-21T08:10:32.489Z")
chatMessageHistoryItem1.SetModifiedDateTime(&modifiedDateTime)
actions := graphmodels.REACTIONADDED_CHATMESSAGEACTIONS
chatMessageHistoryItem1.SetActions(&actions)
reaction := graphmodels.NewChatMessageReaction()
reactionType := "laugh"
reaction.SetReactionType(&reactionType)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
reaction.SetUser(user)
chatMessageHistoryItem1.SetReaction(reaction)
chatMessageHistoryItem2 := graphmodels.NewChatMessageHistoryItem()
modifiedDateTime , err := time.Parse(time.RFC3339, "2018-10-21T02:17:14.67Z")
chatMessageHistoryItem2.SetModifiedDateTime(&modifiedDateTime)
actions := graphmodels.REACTIONADDED_CHATMESSAGEACTIONS
chatMessageHistoryItem2.SetActions(&actions)
reaction := graphmodels.NewChatMessageReaction()
reactionType := "like"
reaction.SetReactionType(&reactionType)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "f1b66449-b46d-49b0-9c3c-53c10a5c818e"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
reaction.SetUser(user)
chatMessageHistoryItem2.SetReaction(reaction)
chatMessageHistoryItem3 := graphmodels.NewChatMessageHistoryItem()
modifiedDateTime , err := time.Parse(time.RFC3339, "2018-10-21T02:34:40.3Z")
chatMessageHistoryItem3.SetModifiedDateTime(&modifiedDateTime)
actions := graphmodels.REACTIONADDED_CHATMESSAGEACTIONS
chatMessageHistoryItem3.SetActions(&actions)
reaction := graphmodels.NewChatMessageReaction()
reactionType := "like"
reaction.SetReactionType(&reactionType)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "4c9041b7-449a-40f7-8855-56da239b9fd1"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
reaction.SetUser(user)
chatMessageHistoryItem3.SetReaction(reaction)
chatMessageHistoryItem4 := graphmodels.NewChatMessageHistoryItem()
modifiedDateTime , err := time.Parse(time.RFC3339, "2018-10-21T08:10:25.489Z")
chatMessageHistoryItem4.SetModifiedDateTime(&modifiedDateTime)
actions := graphmodels.REACTIONADDED_CHATMESSAGEACTIONS
chatMessageHistoryItem4.SetActions(&actions)
reaction := graphmodels.NewChatMessageReaction()
reactionType := "like"
reaction.SetReactionType(&reactionType)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
reaction.SetUser(user)
chatMessageHistoryItem4.SetReaction(reaction)
chatMessageHistoryItem5 := graphmodels.NewChatMessageHistoryItem()
modifiedDateTime , err := time.Parse(time.RFC3339, "2018-10-21T08:10:31.489Z")
chatMessageHistoryItem5.SetModifiedDateTime(&modifiedDateTime)
actions := graphmodels.REACTIONADDED_CHATMESSAGEACTIONS
chatMessageHistoryItem5.SetActions(&actions)
reaction := graphmodels.NewChatMessageReaction()
reactionType := "heart"
reaction.SetReactionType(&reactionType)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
reaction.SetUser(user)
chatMessageHistoryItem5.SetReaction(reaction)
chatMessageHistoryItem6 := graphmodels.NewChatMessageHistoryItem()
modifiedDateTime , err := time.Parse(time.RFC3339, "2018-10-21T08:10:33.489Z")
chatMessageHistoryItem6.SetModifiedDateTime(&modifiedDateTime)
actions := graphmodels.REACTIONADDED_CHATMESSAGEACTIONS
chatMessageHistoryItem6.SetActions(&actions)
reaction := graphmodels.NewChatMessageReaction()
reactionType := "sad"
reaction.SetReactionType(&reactionType)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
reaction.SetUser(user)
chatMessageHistoryItem6.SetReaction(reaction)
chatMessageHistoryItem7 := graphmodels.NewChatMessageHistoryItem()
modifiedDateTime , err := time.Parse(time.RFC3339, "2018-10-21T08:10:34.489Z")
chatMessageHistoryItem7.SetModifiedDateTime(&modifiedDateTime)
actions := graphmodels.SURPRISED_CHATMESSAGEACTIONS
chatMessageHistoryItem7.SetActions(&actions)
reaction := graphmodels.NewChatMessageReaction()
reactionType := "sad"
reaction.SetReactionType(&reactionType)
user := graphmodels.NewChatMessageReactionIdentitySet()
application := null
user.SetApplication(&application)
device := null
user.SetDevice(&device)
user := graphmodels.NewIdentity()
id := "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
user.SetId(&id)
displayName := null
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"userIdentityType" : "aadUser",
}
user.SetAdditionalData(additionalData)
user.SetUser(user)
reaction.SetUser(user)
chatMessageHistoryItem7.SetReaction(reaction)
messageHistory := []graphmodels.ChatMessageHistoryItemable {
chatMessageHistoryItem,
chatMessageHistoryItem1,
chatMessageHistoryItem2,
chatMessageHistoryItem3,
chatMessageHistoryItem4,
chatMessageHistoryItem5,
chatMessageHistoryItem6,
chatMessageHistoryItem7,
}
requestBody.SetMessageHistory(messageHistory)
messages, err := graphClient.Teams().ByTeamId("team-id").Channels().ByChannelId("channel-id").Messages().ByChatMessageId("chatMessage-id").Patch(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
ChatMessage chatMessage = new ChatMessage();
chatMessage.messageType = ChatMessageType.MESSAGE;
chatMessage.subject = null;
chatMessage.summary = null;
chatMessage.importance = ChatMessageImportance.NORMAL;
chatMessage.locale = "en-us";
ChatMessageFromIdentitySet from = new ChatMessageFromIdentitySet();
from.application = null;
from.device = null;
Identity user = new Identity();
user.id = "3b102402-813e-4e17-a6b2-f841aef1fdfc";
user.displayName = "Sumit Gupta";
user.userIdentityType = TeamworkUserIdentityType.AAD_USER;
from.user = user;
from.conversation = null;
chatMessage.from = from;
ItemBody body = new ItemBody();
body.contentType = BodyType.HTML;
body.content = "<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>";
chatMessage.body = body;
LinkedList<ChatMessageAttachment> attachmentsList = new LinkedList<ChatMessageAttachment>();
ChatMessageAttachment attachments = new ChatMessageAttachment();
attachments.id = "e8f78756199240b88448ae0fc6db112d";
attachments.contentType = "application/vnd.microsoft.card.hero";
attachments.contentUrl = null;
attachments.content = "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"openUrl\",\r\n \"image\": \"https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\": \"😃😃 click me 😃😃\",\r\n \"value\": \"http://microsoft.com\"\r\n },\r\n {\r\n \"type\": \"imback\",\r\n \"title\": \"&i am back& <>= \\\"\",\r\n \"value\": \"&i am back& <>= \\\"\"\r\n },\r\n {\r\n \"type\": \"openUrl\",\r\n \"title\": \"Open URL\",\r\n \"value\": \"http://google.com\"\r\n }\r\n ]\r\n}";
attachments.name = null;
attachments.thumbnailUrl = null;
attachmentsList.add(attachments);
ChatMessageAttachment attachments1 = new ChatMessageAttachment();
attachments1.id = "638464e32834471ea202007da60a5ae6";
attachments1.contentType = "application/vnd.microsoft.card.hero";
attachments1.contentUrl = null;
attachments1.content = "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"messageBack\",\r\n \"title\": \"&message back& <>= \\\"\",\r\n \"text\": \"text = &message back& <>= \\\"\",\r\n \"displayText\": \"displayText = &message back& <>= \\\"\",\r\n \"value\": {\r\n \"text\": \"some text 2\"\r\n }\r\n }\r\n ]\r\n}";
attachments1.name = null;
attachments1.thumbnailUrl = null;
attachmentsList.add(attachments1);
chatMessage.attachments = attachmentsList;
LinkedList<ChatMessageMention> mentionsList = new LinkedList<ChatMessageMention>();
chatMessage.mentions = mentionsList;
LinkedList<ChatMessageReaction> reactionsList = new LinkedList<ChatMessageReaction>();
ChatMessageReaction reactions = new ChatMessageReaction();
reactions.reactionType = "angry";
reactions.createdDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T08:10:30.489Z");
ChatMessageReactionIdentitySet user1 = new ChatMessageReactionIdentitySet();
user1.application = null;
user1.device = null;
Identity user1 = new Identity();
user1.id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e";
user1.displayName = null;
user1.userIdentityType = "aadUser";
user1.user = user1;
reactions.user = user2;
reactionsList.add(reactions);
ChatMessageReaction reactions1 = new ChatMessageReaction();
reactions1.reactionType = "laugh";
reactions1.createdDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T08:10:32.489Z");
ChatMessageReactionIdentitySet user3 = new ChatMessageReactionIdentitySet();
user3.application = null;
user3.device = null;
Identity user3 = new Identity();
user3.id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e";
user3.displayName = null;
user3.userIdentityType = "aadUser";
user3.user = user3;
reactions1.user = user4;
reactionsList.add(reactions1);
ChatMessageReaction reactions2 = new ChatMessageReaction();
reactions2.reactionType = "like";
reactions2.createdDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T02:17:14.67Z");
ChatMessageReactionIdentitySet user5 = new ChatMessageReactionIdentitySet();
user5.application = null;
user5.device = null;
Identity user5 = new Identity();
user5.id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e";
user5.displayName = null;
user5.userIdentityType = "aadUser";
user5.user = user5;
reactions2.user = user6;
reactionsList.add(reactions2);
ChatMessageReaction reactions3 = new ChatMessageReaction();
reactions3.reactionType = "like";
reactions3.createdDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T02:34:40.3Z");
ChatMessageReactionIdentitySet user7 = new ChatMessageReactionIdentitySet();
user7.application = null;
user7.device = null;
Identity user7 = new Identity();
user7.id = "4c9041b7-449a-40f7-8855-56da239b9fd1";
user7.displayName = null;
user7.userIdentityType = "aadUser";
user7.user = user7;
reactions3.user = user8;
reactionsList.add(reactions3);
ChatMessageReaction reactions4 = new ChatMessageReaction();
reactions4.reactionType = "like";
reactions4.createdDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T08:10:25.489Z");
ChatMessageReactionIdentitySet user9 = new ChatMessageReactionIdentitySet();
user9.application = null;
user9.device = null;
Identity user9 = new Identity();
user9.id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e";
user9.displayName = null;
user9.userIdentityType = "aadUser";
user9.user = user9;
reactions4.user = user10;
reactionsList.add(reactions4);
ChatMessageReaction reactions5 = new ChatMessageReaction();
reactions5.reactionType = "heart";
reactions5.createdDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T08:10:31.489Z");
ChatMessageReactionIdentitySet user11 = new ChatMessageReactionIdentitySet();
user11.application = null;
user11.device = null;
Identity user11 = new Identity();
user11.id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e";
user11.displayName = null;
user11.userIdentityType = "aadUser";
user11.user = user11;
reactions5.user = user12;
reactionsList.add(reactions5);
ChatMessageReaction reactions6 = new ChatMessageReaction();
reactions6.reactionType = "sad";
reactions6.createdDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T08:10:33.489Z");
ChatMessageReactionIdentitySet user13 = new ChatMessageReactionIdentitySet();
user13.application = null;
user13.device = null;
Identity user13 = new Identity();
user13.id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e";
user13.displayName = null;
user13.userIdentityType = "aadUser";
user13.user = user13;
reactions6.user = user14;
reactionsList.add(reactions6);
ChatMessageReaction reactions7 = new ChatMessageReaction();
reactions7.reactionType = "surprised";
reactions7.createdDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T08:10:34.489Z");
ChatMessageReactionIdentitySet user15 = new ChatMessageReactionIdentitySet();
user15.application = null;
user15.device = null;
Identity user15 = new Identity();
user15.id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e";
user15.displayName = null;
user15.userIdentityType = "aadUser";
user15.user = user15;
reactions7.user = user16;
reactionsList.add(reactions7);
chatMessage.reactions = reactionsList;
LinkedList<ChatMessageHistoryItem> messageHistoryList = new LinkedList<ChatMessageHistoryItem>();
ChatMessageHistoryItem messageHistory = new ChatMessageHistoryItem();
messageHistory.modifiedDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T08:10:30.489Z");
messageHistory.actions = EnumSet.of(ChatMessageActions.REACTION_ADDED);
ChatMessageReaction reaction = new ChatMessageReaction();
reaction.reactionType = "angry";
ChatMessageReactionIdentitySet user17 = new ChatMessageReactionIdentitySet();
user17.application = null;
user17.device = null;
Identity user17 = new Identity();
user17.id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e";
user17.displayName = null;
user17.userIdentityType = "aadUser";
user17.user = user17;
reaction.user = user18;
messageHistory.reaction = reaction;
messageHistoryList.add(messageHistory);
ChatMessageHistoryItem messageHistory1 = new ChatMessageHistoryItem();
messageHistory1.modifiedDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T08:10:32.489Z");
messageHistory1.actions = EnumSet.of(ChatMessageActions.REACTION_ADDED);
ChatMessageReaction reaction1 = new ChatMessageReaction();
reaction1.reactionType = "laugh";
ChatMessageReactionIdentitySet user19 = new ChatMessageReactionIdentitySet();
user19.application = null;
user19.device = null;
Identity user19 = new Identity();
user19.id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e";
user19.displayName = null;
user19.userIdentityType = "aadUser";
user19.user = user19;
reaction1.user = user20;
messageHistory1.reaction = reaction1;
messageHistoryList.add(messageHistory1);
ChatMessageHistoryItem messageHistory2 = new ChatMessageHistoryItem();
messageHistory2.modifiedDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T02:17:14.67Z");
messageHistory2.actions = EnumSet.of(ChatMessageActions.REACTION_ADDED);
ChatMessageReaction reaction2 = new ChatMessageReaction();
reaction2.reactionType = "like";
ChatMessageReactionIdentitySet user21 = new ChatMessageReactionIdentitySet();
user21.application = null;
user21.device = null;
Identity user21 = new Identity();
user21.id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e";
user21.displayName = null;
user21.userIdentityType = "aadUser";
user21.user = user21;
reaction2.user = user22;
messageHistory2.reaction = reaction2;
messageHistoryList.add(messageHistory2);
ChatMessageHistoryItem messageHistory3 = new ChatMessageHistoryItem();
messageHistory3.modifiedDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T02:34:40.3Z");
messageHistory3.actions = EnumSet.of(ChatMessageActions.REACTION_ADDED);
ChatMessageReaction reaction3 = new ChatMessageReaction();
reaction3.reactionType = "like";
ChatMessageReactionIdentitySet user23 = new ChatMessageReactionIdentitySet();
user23.application = null;
user23.device = null;
Identity user23 = new Identity();
user23.id = "4c9041b7-449a-40f7-8855-56da239b9fd1";
user23.displayName = null;
user23.userIdentityType = "aadUser";
user23.user = user23;
reaction3.user = user24;
messageHistory3.reaction = reaction3;
messageHistoryList.add(messageHistory3);
ChatMessageHistoryItem messageHistory4 = new ChatMessageHistoryItem();
messageHistory4.modifiedDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T08:10:25.489Z");
messageHistory4.actions = EnumSet.of(ChatMessageActions.REACTION_ADDED);
ChatMessageReaction reaction4 = new ChatMessageReaction();
reaction4.reactionType = "like";
ChatMessageReactionIdentitySet user25 = new ChatMessageReactionIdentitySet();
user25.application = null;
user25.device = null;
Identity user25 = new Identity();
user25.id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e";
user25.displayName = null;
user25.userIdentityType = "aadUser";
user25.user = user25;
reaction4.user = user26;
messageHistory4.reaction = reaction4;
messageHistoryList.add(messageHistory4);
ChatMessageHistoryItem messageHistory5 = new ChatMessageHistoryItem();
messageHistory5.modifiedDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T08:10:31.489Z");
messageHistory5.actions = EnumSet.of(ChatMessageActions.REACTION_ADDED);
ChatMessageReaction reaction5 = new ChatMessageReaction();
reaction5.reactionType = "heart";
ChatMessageReactionIdentitySet user27 = new ChatMessageReactionIdentitySet();
user27.application = null;
user27.device = null;
Identity user27 = new Identity();
user27.id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e";
user27.displayName = null;
user27.userIdentityType = "aadUser";
user27.user = user27;
reaction5.user = user28;
messageHistory5.reaction = reaction5;
messageHistoryList.add(messageHistory5);
ChatMessageHistoryItem messageHistory6 = new ChatMessageHistoryItem();
messageHistory6.modifiedDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T08:10:33.489Z");
messageHistory6.actions = EnumSet.of(ChatMessageActions.REACTION_ADDED);
ChatMessageReaction reaction6 = new ChatMessageReaction();
reaction6.reactionType = "sad";
ChatMessageReactionIdentitySet user29 = new ChatMessageReactionIdentitySet();
user29.application = null;
user29.device = null;
Identity user29 = new Identity();
user29.id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e";
user29.displayName = null;
user29.userIdentityType = "aadUser";
user29.user = user29;
reaction6.user = user30;
messageHistory6.reaction = reaction6;
messageHistoryList.add(messageHistory6);
ChatMessageHistoryItem messageHistory7 = new ChatMessageHistoryItem();
messageHistory7.modifiedDateTime = OffsetDateTimeSerializer.deserialize("2018-10-21T08:10:34.489Z");
messageHistory7.actions = EnumSet.of(ChatMessageActions.REACTION_ADDED);
ChatMessageReaction reaction7 = new ChatMessageReaction();
reaction7.reactionType = "sad";
ChatMessageReactionIdentitySet user31 = new ChatMessageReactionIdentitySet();
user31.application = null;
user31.device = null;
Identity user31 = new Identity();
user31.id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e";
user31.displayName = null;
user31.userIdentityType = "aadUser";
user31.user = user31;
reaction7.user = user32;
messageHistory7.reaction = reaction7;
messageHistoryList.add(messageHistory7);
chatMessage.messageHistory = messageHistoryList;
graphClient.teams("e1234567-e123-4276-55555-6232b0e3a89a").channels("a7654321-e321-0000-0000-123b0e3a00a").messages("19:a21b0b0c05194ebc9e30000000000f61@thread.skype")
.buildRequest()
.patch(chatMessage);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
const chatMessage = {
messageType: 'message',
subject: null,
summary: null,
importance: 'normal',
locale: 'en-us',
from: {
application: null,
device: null,
user: {
id: '3b102402-813e-4e17-a6b2-f841aef1fdfc',
displayName: 'Sumit Gupta',
userIdentityType: 'aadUser'
},
conversation: null
},
body: {
contentType: 'html',
content: '<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>'
},
attachments: [
{
id: 'e8f78756199240b88448ae0fc6db112d',
contentType: 'application/vnd.microsoft.card.hero',
contentUrl: null,
content: '{\r\n \"title\': \'*title*\",\r\n \"subtitle\': \'*subtitle*\",\r\n \"text\': \'Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you\'re cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\': [\r\n {\r\n \'url\': \'https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\': [\r\n {\r\n \'type\': \'openUrl\",\r\n \"image\': \'https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\': \'😃😃 click me 😃😃\",\r\n \"value\': \'http://microsoft.com\"\r\n },\r\n {\r\n \"type\': \'imback\",\r\n \"title\': \'&i am back& <>= \\\"\",\r\n \"value\': \'&i am back& <>= \\\"\"\r\n },\r\n {\r\n \"type\': \'openUrl\",\r\n \"title\': \'Open URL\",\r\n \"value\': \"http://google.com\"\r\n }\r\n ]\r\n}",
name: null,
thumbnailUrl: null
},
{
id: '638464e32834471ea202007da60a5ae6',
contentType: 'application/vnd.microsoft.card.hero',
contentUrl: null,
content: '{\r\n \"title\': \'*title*\",\r\n \"subtitle\': \'*subtitle*\",\r\n \"text\': \'Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you\'re cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\': [\r\n {\r\n \'url\': \'https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\': [\r\n {\r\n \'type\': \'messageBack\",\r\n \"title\': \'&message back& <>= \\\"\",\r\n \"text\': \'text = &message back& <>= \\\"\",\r\n \"displayText\': \'displayText = &message back& <>= \\\"\",\r\n \"value\': {\r\n \'text\': \"some text 2\"\r\n }\r\n }\r\n ]\r\n}",
name: null,
thumbnailUrl: null
}
],
mentions: [],
reactions: [
{
reactionType: 'angry',
createdDateTime: '2018-10-21T08:10:30.489Z',
user: {
application: null,
device: null,
user: {
id: 'f1b66449-b46d-49b0-9c3c-53c10a5c818e',
displayName: null,
userIdentityType: 'aadUser'
}
}
},
{
reactionType: 'laugh',
createdDateTime: '2018-10-21T08:10:32.489Z',
user: {
application: null,
device: null,
user: {
id: '03a02232-d8f5-4970-a77e-6e8c76ce7a4e',
displayName: null,
userIdentityType: 'aadUser'
}
}
},
{
reactionType: 'like',
createdDateTime: '2018-10-21T02:17:14.67Z',
user: {
application: null,
device: null,
user: {
id: 'f1b66449-b46d-49b0-9c3c-53c10a5c818e',
displayName: null,
userIdentityType: 'aadUser'
}
}
},
{
reactionType: 'like',
createdDateTime: '2018-10-21T02:34:40.3Z',
user: {
application: null,
device: null,
user: {
id: '4c9041b7-449a-40f7-8855-56da239b9fd1',
displayName: null,
userIdentityType: 'aadUser'
}
}
},
{
reactionType: 'like',
createdDateTime: '2018-10-21T08:10:25.489Z',
user: {
application: null,
device: null,
user: {
id: '03a02232-d8f5-4970-a77e-6e8c76ce7a4e',
displayName: null,
userIdentityType: 'aadUser'
}
}
},
{
reactionType: 'heart',
createdDateTime: '2018-10-21T08:10:31.489Z',
user: {
application: null,
device: null,
user: {
id: '03a02232-d8f5-4970-a77e-6e8c76ce7a4e',
displayName: null,
userIdentityType: 'aadUser'
}
}
},
{
reactionType: 'sad',
createdDateTime: '2018-10-21T08:10:33.489Z',
user: {
application: null,
device: null,
user: {
id: '03a02232-d8f5-4970-a77e-6e8c76ce7a4e',
displayName: null,
userIdentityType: 'aadUser'
}
}
},
{
reactionType: 'surprised',
createdDateTime: '2018-10-21T08:10:34.489Z',
user: {
application: null,
device: null,
user: {
id: '03a02232-d8f5-4970-a77e-6e8c76ce7a4e',
displayName: null,
userIdentityType: 'aadUser'
}
}
}
],
messageHistory: [
{
modifiedDateTime: '2018-10-21T08:10:30.489Z',
actions: 'reactionAdded',
reaction: {
reactionType: 'angry',
user: {
application: null,
device: null,
user: {
id: 'f1b66449-b46d-49b0-9c3c-53c10a5c818e',
displayName: null,
userIdentityType: 'aadUser'
}
}
}
},
{
modifiedDateTime: '2018-10-21T08:10:32.489Z',
actions: 'reactionAdded',
reaction: {
reactionType: 'laugh',
user: {
application: null,
device: null,
user: {
id: '03a02232-d8f5-4970-a77e-6e8c76ce7a4e',
displayName: null,
userIdentityType: 'aadUser'
}
}
}
},
{
modifiedDateTime: '2018-10-21T02:17:14.67Z',
actions: 'reactionAdded',
reaction: {
reactionType: 'like',
user: {
application: null,
device: null,
user: {
id: 'f1b66449-b46d-49b0-9c3c-53c10a5c818e',
displayName: null,
userIdentityType: 'aadUser'
}
}
}
},
{
modifiedDateTime: '2018-10-21T02:34:40.3Z',
actions: 'reactionAdded',
reaction: {
reactionType: 'like',
user: {
application: null,
device: null,
user: {
id: '4c9041b7-449a-40f7-8855-56da239b9fd1',
displayName: null,
userIdentityType: 'aadUser'
}
}
}
},
{
modifiedDateTime: '2018-10-21T08:10:25.489Z',
actions: 'reactionAdded',
reaction: {
reactionType: 'like',
user: {
application: null,
device: null,
user: {
id: '03a02232-d8f5-4970-a77e-6e8c76ce7a4e',
displayName: null,
userIdentityType: 'aadUser'
}
}
}
},
{
modifiedDateTime: '2018-10-21T08:10:31.489Z',
actions: 'reactionAdded',
reaction: {
reactionType: 'heart',
user: {
application: null,
device: null,
user: {
id: '03a02232-d8f5-4970-a77e-6e8c76ce7a4e',
displayName: null,
userIdentityType: 'aadUser'
}
}
}
},
{
modifiedDateTime: '2018-10-21T08:10:33.489Z',
actions: 'reactionAdded',
reaction: {
reactionType: 'sad',
user: {
application: null,
device: null,
user: {
id: '03a02232-d8f5-4970-a77e-6e8c76ce7a4e',
displayName: null,
userIdentityType: 'aadUser'
}
}
}
},
{
modifiedDateTime: '2018-10-21T08:10:34.489Z',
actions: 'surprised',
reaction: {
reactionType: 'sad',
user: {
application: null,
device: null,
user: {
id: '03a02232-d8f5-4970-a77e-6e8c76ce7a4e',
displayName: null,
userIdentityType: 'aadUser'
}
}
}
}
]
};
await client.api('/teams/e1234567-e123-4276-55555-6232b0e3a89a/channels/a7654321-e321-0000-0000-123b0e3a00a/messages/19:a21b0b0c05194ebc9e30000000000f61@thread.skype')
.version('beta')
.update(chatMessage);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ChatMessage();
$requestBody->setMessageType(new ChatMessageType('message'));
$requestBody->setSubject(null);
$requestBody->setSummary(null);
$requestBody->setImportance(new ChatMessageImportance('normal'));
$requestBody->setLocale('en-us');
$from = new ChatMessageFromIdentitySet();
$from->setApplication(null);
$from->setDevice(null);
$fromUser = new Identity();
$fromUser->setId('3b102402-813e-4e17-a6b2-f841aef1fdfc');
$fromUser->setDisplayName('Sumit Gupta');
$additionalData = [
'userIdentityType' => 'aadUser',
];
$fromUser->setAdditionalData($additionalData);
$from->setUser($fromUser);
$additionalData = [
'conversation' => null,
];
$from->setAdditionalData($additionalData);
$requestBody->setFrom($from);
$body = new ItemBody();
$body->setContentType(new BodyType('html'));
$body->setContent('<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>');
$requestBody->setBody($body);
$attachmentsChatMessageAttachment1 = new ChatMessageAttachment();
$attachmentsChatMessageAttachment1->setId('e8f78756199240b88448ae0fc6db112d');
$attachmentsChatMessageAttachment1->setContentType('application/vnd.microsoft.card.hero');
$attachmentsChatMessageAttachment1->setContentUrl(null);
$attachmentsChatMessageAttachment1->setContent('{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you\'re cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"openUrl\",\r\n \"image\": \"https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\": \"😃😃 click me 😃😃\",\r\n \"value\": \"http://microsoft.com\"\r\n },\r\n {\r\n \"type\": \"imback\",\r\n \"title\": \"&i am back& <>= \"\",\r\n \"value\": \"&i am back& <>= \"\"\r\n },\r\n {\r\n \"type\": \"openUrl\",\r\n \"title\": \"Open URL\",\r\n \"value\": \"http://google.com\"\r\n }\r\n ]\r\n}');
$attachmentsChatMessageAttachment1->setName(null);
$attachmentsChatMessageAttachment1->setThumbnailUrl(null);
$attachmentsArray []= $attachmentsChatMessageAttachment1;
$attachmentsChatMessageAttachment2 = new ChatMessageAttachment();
$attachmentsChatMessageAttachment2->setId('638464e32834471ea202007da60a5ae6');
$attachmentsChatMessageAttachment2->setContentType('application/vnd.microsoft.card.hero');
$attachmentsChatMessageAttachment2->setContentUrl(null);
$attachmentsChatMessageAttachment2->setContent('{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you\'re cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"messageBack\",\r\n \"title\": \"&message back& <>= \"\",\r\n \"text\": \"text = &message back& <>= \"\",\r\n \"displayText\": \"displayText = &message back& <>= \"\",\r\n \"value\": {\r\n \"text\": \"some text 2\"\r\n }\r\n }\r\n ]\r\n}');
$attachmentsChatMessageAttachment2->setName(null);
$attachmentsChatMessageAttachment2->setThumbnailUrl(null);
$attachmentsArray []= $attachmentsChatMessageAttachment2;
$requestBody->setAttachments($attachmentsArray);
$requestBody->setMentions([]);
$reactionsChatMessageReaction1 = new ChatMessageReaction();
$reactionsChatMessageReaction1->setReactionType('angry');
$reactionsChatMessageReaction1->setCreatedDateTime(new \DateTime('2018-10-21T08:10:30.489Z'));
$reactionsChatMessageReaction1User = new ChatMessageReactionIdentitySet();
$reactionsChatMessageReaction1User->setApplication(null);
$reactionsChatMessageReaction1User->setDevice(null);
$reactionsChatMessageReaction1UserUser = new Identity();
$reactionsChatMessageReaction1UserUser->setId('f1b66449-b46d-49b0-9c3c-53c10a5c818e');
$reactionsChatMessageReaction1UserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$reactionsChatMessageReaction1UserUser->setAdditionalData($additionalData);
$reactionsChatMessageReaction1User->setUser($reactionsChatMessageReaction1UserUser);
$reactionsChatMessageReaction1->setUser($reactionsChatMessageReaction1User);
$reactionsArray []= $reactionsChatMessageReaction1;
$reactionsChatMessageReaction2 = new ChatMessageReaction();
$reactionsChatMessageReaction2->setReactionType('laugh');
$reactionsChatMessageReaction2->setCreatedDateTime(new \DateTime('2018-10-21T08:10:32.489Z'));
$reactionsChatMessageReaction2User = new ChatMessageReactionIdentitySet();
$reactionsChatMessageReaction2User->setApplication(null);
$reactionsChatMessageReaction2User->setDevice(null);
$reactionsChatMessageReaction2UserUser = new Identity();
$reactionsChatMessageReaction2UserUser->setId('03a02232-d8f5-4970-a77e-6e8c76ce7a4e');
$reactionsChatMessageReaction2UserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$reactionsChatMessageReaction2UserUser->setAdditionalData($additionalData);
$reactionsChatMessageReaction2User->setUser($reactionsChatMessageReaction2UserUser);
$reactionsChatMessageReaction2->setUser($reactionsChatMessageReaction2User);
$reactionsArray []= $reactionsChatMessageReaction2;
$reactionsChatMessageReaction3 = new ChatMessageReaction();
$reactionsChatMessageReaction3->setReactionType('like');
$reactionsChatMessageReaction3->setCreatedDateTime(new \DateTime('2018-10-21T02:17:14.67Z'));
$reactionsChatMessageReaction3User = new ChatMessageReactionIdentitySet();
$reactionsChatMessageReaction3User->setApplication(null);
$reactionsChatMessageReaction3User->setDevice(null);
$reactionsChatMessageReaction3UserUser = new Identity();
$reactionsChatMessageReaction3UserUser->setId('f1b66449-b46d-49b0-9c3c-53c10a5c818e');
$reactionsChatMessageReaction3UserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$reactionsChatMessageReaction3UserUser->setAdditionalData($additionalData);
$reactionsChatMessageReaction3User->setUser($reactionsChatMessageReaction3UserUser);
$reactionsChatMessageReaction3->setUser($reactionsChatMessageReaction3User);
$reactionsArray []= $reactionsChatMessageReaction3;
$reactionsChatMessageReaction4 = new ChatMessageReaction();
$reactionsChatMessageReaction4->setReactionType('like');
$reactionsChatMessageReaction4->setCreatedDateTime(new \DateTime('2018-10-21T02:34:40.3Z'));
$reactionsChatMessageReaction4User = new ChatMessageReactionIdentitySet();
$reactionsChatMessageReaction4User->setApplication(null);
$reactionsChatMessageReaction4User->setDevice(null);
$reactionsChatMessageReaction4UserUser = new Identity();
$reactionsChatMessageReaction4UserUser->setId('4c9041b7-449a-40f7-8855-56da239b9fd1');
$reactionsChatMessageReaction4UserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$reactionsChatMessageReaction4UserUser->setAdditionalData($additionalData);
$reactionsChatMessageReaction4User->setUser($reactionsChatMessageReaction4UserUser);
$reactionsChatMessageReaction4->setUser($reactionsChatMessageReaction4User);
$reactionsArray []= $reactionsChatMessageReaction4;
$reactionsChatMessageReaction5 = new ChatMessageReaction();
$reactionsChatMessageReaction5->setReactionType('like');
$reactionsChatMessageReaction5->setCreatedDateTime(new \DateTime('2018-10-21T08:10:25.489Z'));
$reactionsChatMessageReaction5User = new ChatMessageReactionIdentitySet();
$reactionsChatMessageReaction5User->setApplication(null);
$reactionsChatMessageReaction5User->setDevice(null);
$reactionsChatMessageReaction5UserUser = new Identity();
$reactionsChatMessageReaction5UserUser->setId('03a02232-d8f5-4970-a77e-6e8c76ce7a4e');
$reactionsChatMessageReaction5UserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$reactionsChatMessageReaction5UserUser->setAdditionalData($additionalData);
$reactionsChatMessageReaction5User->setUser($reactionsChatMessageReaction5UserUser);
$reactionsChatMessageReaction5->setUser($reactionsChatMessageReaction5User);
$reactionsArray []= $reactionsChatMessageReaction5;
$reactionsChatMessageReaction6 = new ChatMessageReaction();
$reactionsChatMessageReaction6->setReactionType('heart');
$reactionsChatMessageReaction6->setCreatedDateTime(new \DateTime('2018-10-21T08:10:31.489Z'));
$reactionsChatMessageReaction6User = new ChatMessageReactionIdentitySet();
$reactionsChatMessageReaction6User->setApplication(null);
$reactionsChatMessageReaction6User->setDevice(null);
$reactionsChatMessageReaction6UserUser = new Identity();
$reactionsChatMessageReaction6UserUser->setId('03a02232-d8f5-4970-a77e-6e8c76ce7a4e');
$reactionsChatMessageReaction6UserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$reactionsChatMessageReaction6UserUser->setAdditionalData($additionalData);
$reactionsChatMessageReaction6User->setUser($reactionsChatMessageReaction6UserUser);
$reactionsChatMessageReaction6->setUser($reactionsChatMessageReaction6User);
$reactionsArray []= $reactionsChatMessageReaction6;
$reactionsChatMessageReaction7 = new ChatMessageReaction();
$reactionsChatMessageReaction7->setReactionType('sad');
$reactionsChatMessageReaction7->setCreatedDateTime(new \DateTime('2018-10-21T08:10:33.489Z'));
$reactionsChatMessageReaction7User = new ChatMessageReactionIdentitySet();
$reactionsChatMessageReaction7User->setApplication(null);
$reactionsChatMessageReaction7User->setDevice(null);
$reactionsChatMessageReaction7UserUser = new Identity();
$reactionsChatMessageReaction7UserUser->setId('03a02232-d8f5-4970-a77e-6e8c76ce7a4e');
$reactionsChatMessageReaction7UserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$reactionsChatMessageReaction7UserUser->setAdditionalData($additionalData);
$reactionsChatMessageReaction7User->setUser($reactionsChatMessageReaction7UserUser);
$reactionsChatMessageReaction7->setUser($reactionsChatMessageReaction7User);
$reactionsArray []= $reactionsChatMessageReaction7;
$reactionsChatMessageReaction8 = new ChatMessageReaction();
$reactionsChatMessageReaction8->setReactionType('surprised');
$reactionsChatMessageReaction8->setCreatedDateTime(new \DateTime('2018-10-21T08:10:34.489Z'));
$reactionsChatMessageReaction8User = new ChatMessageReactionIdentitySet();
$reactionsChatMessageReaction8User->setApplication(null);
$reactionsChatMessageReaction8User->setDevice(null);
$reactionsChatMessageReaction8UserUser = new Identity();
$reactionsChatMessageReaction8UserUser->setId('03a02232-d8f5-4970-a77e-6e8c76ce7a4e');
$reactionsChatMessageReaction8UserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$reactionsChatMessageReaction8UserUser->setAdditionalData($additionalData);
$reactionsChatMessageReaction8User->setUser($reactionsChatMessageReaction8UserUser);
$reactionsChatMessageReaction8->setUser($reactionsChatMessageReaction8User);
$reactionsArray []= $reactionsChatMessageReaction8;
$requestBody->setReactions($reactionsArray);
$messageHistoryChatMessageHistoryItem1 = new ChatMessageHistoryItem();
$messageHistoryChatMessageHistoryItem1->setModifiedDateTime(new \DateTime('2018-10-21T08:10:30.489Z'));
$messageHistoryChatMessageHistoryItem1->setActions(new ChatMessageActions('reactionAdded'));
$messageHistoryChatMessageHistoryItem1Reaction = new ChatMessageReaction();
$messageHistoryChatMessageHistoryItem1Reaction->setReactionType('angry');
$messageHistoryChatMessageHistoryItem1ReactionUser = new ChatMessageReactionIdentitySet();
$messageHistoryChatMessageHistoryItem1ReactionUser->setApplication(null);
$messageHistoryChatMessageHistoryItem1ReactionUser->setDevice(null);
$messageHistoryChatMessageHistoryItem1ReactionUserUser = new Identity();
$messageHistoryChatMessageHistoryItem1ReactionUserUser->setId('f1b66449-b46d-49b0-9c3c-53c10a5c818e');
$messageHistoryChatMessageHistoryItem1ReactionUserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$messageHistoryChatMessageHistoryItem1ReactionUserUser->setAdditionalData($additionalData);
$messageHistoryChatMessageHistoryItem1ReactionUser->setUser($messageHistoryChatMessageHistoryItem1ReactionUserUser);
$messageHistoryChatMessageHistoryItem1Reaction->setUser($messageHistoryChatMessageHistoryItem1ReactionUser);
$messageHistoryChatMessageHistoryItem1->setReaction($messageHistoryChatMessageHistoryItem1Reaction);
$messageHistoryArray []= $messageHistoryChatMessageHistoryItem1;
$messageHistoryChatMessageHistoryItem2 = new ChatMessageHistoryItem();
$messageHistoryChatMessageHistoryItem2->setModifiedDateTime(new \DateTime('2018-10-21T08:10:32.489Z'));
$messageHistoryChatMessageHistoryItem2->setActions(new ChatMessageActions('reactionAdded'));
$messageHistoryChatMessageHistoryItem2Reaction = new ChatMessageReaction();
$messageHistoryChatMessageHistoryItem2Reaction->setReactionType('laugh');
$messageHistoryChatMessageHistoryItem2ReactionUser = new ChatMessageReactionIdentitySet();
$messageHistoryChatMessageHistoryItem2ReactionUser->setApplication(null);
$messageHistoryChatMessageHistoryItem2ReactionUser->setDevice(null);
$messageHistoryChatMessageHistoryItem2ReactionUserUser = new Identity();
$messageHistoryChatMessageHistoryItem2ReactionUserUser->setId('03a02232-d8f5-4970-a77e-6e8c76ce7a4e');
$messageHistoryChatMessageHistoryItem2ReactionUserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$messageHistoryChatMessageHistoryItem2ReactionUserUser->setAdditionalData($additionalData);
$messageHistoryChatMessageHistoryItem2ReactionUser->setUser($messageHistoryChatMessageHistoryItem2ReactionUserUser);
$messageHistoryChatMessageHistoryItem2Reaction->setUser($messageHistoryChatMessageHistoryItem2ReactionUser);
$messageHistoryChatMessageHistoryItem2->setReaction($messageHistoryChatMessageHistoryItem2Reaction);
$messageHistoryArray []= $messageHistoryChatMessageHistoryItem2;
$messageHistoryChatMessageHistoryItem3 = new ChatMessageHistoryItem();
$messageHistoryChatMessageHistoryItem3->setModifiedDateTime(new \DateTime('2018-10-21T02:17:14.67Z'));
$messageHistoryChatMessageHistoryItem3->setActions(new ChatMessageActions('reactionAdded'));
$messageHistoryChatMessageHistoryItem3Reaction = new ChatMessageReaction();
$messageHistoryChatMessageHistoryItem3Reaction->setReactionType('like');
$messageHistoryChatMessageHistoryItem3ReactionUser = new ChatMessageReactionIdentitySet();
$messageHistoryChatMessageHistoryItem3ReactionUser->setApplication(null);
$messageHistoryChatMessageHistoryItem3ReactionUser->setDevice(null);
$messageHistoryChatMessageHistoryItem3ReactionUserUser = new Identity();
$messageHistoryChatMessageHistoryItem3ReactionUserUser->setId('f1b66449-b46d-49b0-9c3c-53c10a5c818e');
$messageHistoryChatMessageHistoryItem3ReactionUserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$messageHistoryChatMessageHistoryItem3ReactionUserUser->setAdditionalData($additionalData);
$messageHistoryChatMessageHistoryItem3ReactionUser->setUser($messageHistoryChatMessageHistoryItem3ReactionUserUser);
$messageHistoryChatMessageHistoryItem3Reaction->setUser($messageHistoryChatMessageHistoryItem3ReactionUser);
$messageHistoryChatMessageHistoryItem3->setReaction($messageHistoryChatMessageHistoryItem3Reaction);
$messageHistoryArray []= $messageHistoryChatMessageHistoryItem3;
$messageHistoryChatMessageHistoryItem4 = new ChatMessageHistoryItem();
$messageHistoryChatMessageHistoryItem4->setModifiedDateTime(new \DateTime('2018-10-21T02:34:40.3Z'));
$messageHistoryChatMessageHistoryItem4->setActions(new ChatMessageActions('reactionAdded'));
$messageHistoryChatMessageHistoryItem4Reaction = new ChatMessageReaction();
$messageHistoryChatMessageHistoryItem4Reaction->setReactionType('like');
$messageHistoryChatMessageHistoryItem4ReactionUser = new ChatMessageReactionIdentitySet();
$messageHistoryChatMessageHistoryItem4ReactionUser->setApplication(null);
$messageHistoryChatMessageHistoryItem4ReactionUser->setDevice(null);
$messageHistoryChatMessageHistoryItem4ReactionUserUser = new Identity();
$messageHistoryChatMessageHistoryItem4ReactionUserUser->setId('4c9041b7-449a-40f7-8855-56da239b9fd1');
$messageHistoryChatMessageHistoryItem4ReactionUserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$messageHistoryChatMessageHistoryItem4ReactionUserUser->setAdditionalData($additionalData);
$messageHistoryChatMessageHistoryItem4ReactionUser->setUser($messageHistoryChatMessageHistoryItem4ReactionUserUser);
$messageHistoryChatMessageHistoryItem4Reaction->setUser($messageHistoryChatMessageHistoryItem4ReactionUser);
$messageHistoryChatMessageHistoryItem4->setReaction($messageHistoryChatMessageHistoryItem4Reaction);
$messageHistoryArray []= $messageHistoryChatMessageHistoryItem4;
$messageHistoryChatMessageHistoryItem5 = new ChatMessageHistoryItem();
$messageHistoryChatMessageHistoryItem5->setModifiedDateTime(new \DateTime('2018-10-21T08:10:25.489Z'));
$messageHistoryChatMessageHistoryItem5->setActions(new ChatMessageActions('reactionAdded'));
$messageHistoryChatMessageHistoryItem5Reaction = new ChatMessageReaction();
$messageHistoryChatMessageHistoryItem5Reaction->setReactionType('like');
$messageHistoryChatMessageHistoryItem5ReactionUser = new ChatMessageReactionIdentitySet();
$messageHistoryChatMessageHistoryItem5ReactionUser->setApplication(null);
$messageHistoryChatMessageHistoryItem5ReactionUser->setDevice(null);
$messageHistoryChatMessageHistoryItem5ReactionUserUser = new Identity();
$messageHistoryChatMessageHistoryItem5ReactionUserUser->setId('03a02232-d8f5-4970-a77e-6e8c76ce7a4e');
$messageHistoryChatMessageHistoryItem5ReactionUserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$messageHistoryChatMessageHistoryItem5ReactionUserUser->setAdditionalData($additionalData);
$messageHistoryChatMessageHistoryItem5ReactionUser->setUser($messageHistoryChatMessageHistoryItem5ReactionUserUser);
$messageHistoryChatMessageHistoryItem5Reaction->setUser($messageHistoryChatMessageHistoryItem5ReactionUser);
$messageHistoryChatMessageHistoryItem5->setReaction($messageHistoryChatMessageHistoryItem5Reaction);
$messageHistoryArray []= $messageHistoryChatMessageHistoryItem5;
$messageHistoryChatMessageHistoryItem6 = new ChatMessageHistoryItem();
$messageHistoryChatMessageHistoryItem6->setModifiedDateTime(new \DateTime('2018-10-21T08:10:31.489Z'));
$messageHistoryChatMessageHistoryItem6->setActions(new ChatMessageActions('reactionAdded'));
$messageHistoryChatMessageHistoryItem6Reaction = new ChatMessageReaction();
$messageHistoryChatMessageHistoryItem6Reaction->setReactionType('heart');
$messageHistoryChatMessageHistoryItem6ReactionUser = new ChatMessageReactionIdentitySet();
$messageHistoryChatMessageHistoryItem6ReactionUser->setApplication(null);
$messageHistoryChatMessageHistoryItem6ReactionUser->setDevice(null);
$messageHistoryChatMessageHistoryItem6ReactionUserUser = new Identity();
$messageHistoryChatMessageHistoryItem6ReactionUserUser->setId('03a02232-d8f5-4970-a77e-6e8c76ce7a4e');
$messageHistoryChatMessageHistoryItem6ReactionUserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$messageHistoryChatMessageHistoryItem6ReactionUserUser->setAdditionalData($additionalData);
$messageHistoryChatMessageHistoryItem6ReactionUser->setUser($messageHistoryChatMessageHistoryItem6ReactionUserUser);
$messageHistoryChatMessageHistoryItem6Reaction->setUser($messageHistoryChatMessageHistoryItem6ReactionUser);
$messageHistoryChatMessageHistoryItem6->setReaction($messageHistoryChatMessageHistoryItem6Reaction);
$messageHistoryArray []= $messageHistoryChatMessageHistoryItem6;
$messageHistoryChatMessageHistoryItem7 = new ChatMessageHistoryItem();
$messageHistoryChatMessageHistoryItem7->setModifiedDateTime(new \DateTime('2018-10-21T08:10:33.489Z'));
$messageHistoryChatMessageHistoryItem7->setActions(new ChatMessageActions('reactionAdded'));
$messageHistoryChatMessageHistoryItem7Reaction = new ChatMessageReaction();
$messageHistoryChatMessageHistoryItem7Reaction->setReactionType('sad');
$messageHistoryChatMessageHistoryItem7ReactionUser = new ChatMessageReactionIdentitySet();
$messageHistoryChatMessageHistoryItem7ReactionUser->setApplication(null);
$messageHistoryChatMessageHistoryItem7ReactionUser->setDevice(null);
$messageHistoryChatMessageHistoryItem7ReactionUserUser = new Identity();
$messageHistoryChatMessageHistoryItem7ReactionUserUser->setId('03a02232-d8f5-4970-a77e-6e8c76ce7a4e');
$messageHistoryChatMessageHistoryItem7ReactionUserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$messageHistoryChatMessageHistoryItem7ReactionUserUser->setAdditionalData($additionalData);
$messageHistoryChatMessageHistoryItem7ReactionUser->setUser($messageHistoryChatMessageHistoryItem7ReactionUserUser);
$messageHistoryChatMessageHistoryItem7Reaction->setUser($messageHistoryChatMessageHistoryItem7ReactionUser);
$messageHistoryChatMessageHistoryItem7->setReaction($messageHistoryChatMessageHistoryItem7Reaction);
$messageHistoryArray []= $messageHistoryChatMessageHistoryItem7;
$messageHistoryChatMessageHistoryItem8 = new ChatMessageHistoryItem();
$messageHistoryChatMessageHistoryItem8->setModifiedDateTime(new \DateTime('2018-10-21T08:10:34.489Z'));
$messageHistoryChatMessageHistoryItem8->setActions(new ChatMessageActions('surprised'));
$messageHistoryChatMessageHistoryItem8Reaction = new ChatMessageReaction();
$messageHistoryChatMessageHistoryItem8Reaction->setReactionType('sad');
$messageHistoryChatMessageHistoryItem8ReactionUser = new ChatMessageReactionIdentitySet();
$messageHistoryChatMessageHistoryItem8ReactionUser->setApplication(null);
$messageHistoryChatMessageHistoryItem8ReactionUser->setDevice(null);
$messageHistoryChatMessageHistoryItem8ReactionUserUser = new Identity();
$messageHistoryChatMessageHistoryItem8ReactionUserUser->setId('03a02232-d8f5-4970-a77e-6e8c76ce7a4e');
$messageHistoryChatMessageHistoryItem8ReactionUserUser->setDisplayName(null);
$additionalData = [
'userIdentityType' => 'aadUser',
];
$messageHistoryChatMessageHistoryItem8ReactionUserUser->setAdditionalData($additionalData);
$messageHistoryChatMessageHistoryItem8ReactionUser->setUser($messageHistoryChatMessageHistoryItem8ReactionUserUser);
$messageHistoryChatMessageHistoryItem8Reaction->setUser($messageHistoryChatMessageHistoryItem8ReactionUser);
$messageHistoryChatMessageHistoryItem8->setReaction($messageHistoryChatMessageHistoryItem8Reaction);
$messageHistoryArray []= $messageHistoryChatMessageHistoryItem8;
$requestBody->setMessageHistory($messageHistoryArray);
$result = $graphServiceClient->teams()->byTeamId('team-id')->channels()->byChannelId('channel-id')->messages()->byChatMessageId('chatMessage-id')->patch($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
messageType = "message"
subject = $null
summary = $null
importance = "normal"
locale = "en-us"
from = @{
application = $null
device = $null
user = @{
id = "3b102402-813e-4e17-a6b2-f841aef1fdfc"
displayName = "Sumit Gupta"
userIdentityType = "aadUser"
}
conversation = $null
}
body = @{
contentType = "html"
content = "<p><em>text</em></p><attachment id="e8f78756199240b88448ae0fc6db112d"></attachment><attachment id="638464e32834471ea202007da60a5ae6"></attachment>"
}
attachments = @(
@{
id = "e8f78756199240b88448ae0fc6db112d"
contentType = "application/vnd.microsoft.card.hero"
contentUrl = $null
content = '{
"title": "*title*",
"subtitle": "*subtitle*",
"text": "Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.",
"images": [
{
"url": "https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview"
}
],
"buttons": [
{
"type": "openUrl",
"image": "https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png",
"title": "😃😃 click me 😃😃",
"value": "http://microsoft.com"
},
{
"type": "imback",
"title": "&i am back& <>= \"",
"value": "&i am back& <>= \""
},
{
"type": "openUrl",
"title": "Open URL",
"value": "http://google.com"
}
]
}'
name = $null
thumbnailUrl = $null
}
@{
id = "638464e32834471ea202007da60a5ae6"
contentType = "application/vnd.microsoft.card.hero"
contentUrl = $null
content = '{
"title": "*title*",
"subtitle": "*subtitle*",
"text": "Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.",
"images": [
{
"url": "https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview"
}
],
"buttons": [
{
"type": "messageBack",
"title": "&message back& <>= \"",
"text": "text = &message back& <>= \"",
"displayText": "displayText = &message back& <>= \"",
"value": {
"text": "some text 2"
}
}
]
}'
name = $null
thumbnailUrl = $null
}
)
mentions = @(
)
reactions = @(
@{
reactionType = "angry"
createdDateTime = [System.DateTime]::Parse("2018-10-21T08:10:30.489Z")
user = @{
application = $null
device = $null
user = @{
id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e"
displayName = $null
userIdentityType = "aadUser"
}
}
}
@{
reactionType = "laugh"
createdDateTime = [System.DateTime]::Parse("2018-10-21T08:10:32.489Z")
user = @{
application = $null
device = $null
user = @{
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
displayName = $null
userIdentityType = "aadUser"
}
}
}
@{
reactionType = "like"
createdDateTime = [System.DateTime]::Parse("2018-10-21T02:17:14.67Z")
user = @{
application = $null
device = $null
user = @{
id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e"
displayName = $null
userIdentityType = "aadUser"
}
}
}
@{
reactionType = "like"
createdDateTime = [System.DateTime]::Parse("2018-10-21T02:34:40.3Z")
user = @{
application = $null
device = $null
user = @{
id = "4c9041b7-449a-40f7-8855-56da239b9fd1"
displayName = $null
userIdentityType = "aadUser"
}
}
}
@{
reactionType = "like"
createdDateTime = [System.DateTime]::Parse("2018-10-21T08:10:25.489Z")
user = @{
application = $null
device = $null
user = @{
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
displayName = $null
userIdentityType = "aadUser"
}
}
}
@{
reactionType = "heart"
createdDateTime = [System.DateTime]::Parse("2018-10-21T08:10:31.489Z")
user = @{
application = $null
device = $null
user = @{
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
displayName = $null
userIdentityType = "aadUser"
}
}
}
@{
reactionType = "sad"
createdDateTime = [System.DateTime]::Parse("2018-10-21T08:10:33.489Z")
user = @{
application = $null
device = $null
user = @{
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
displayName = $null
userIdentityType = "aadUser"
}
}
}
@{
reactionType = "surprised"
createdDateTime = [System.DateTime]::Parse("2018-10-21T08:10:34.489Z")
user = @{
application = $null
device = $null
user = @{
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
displayName = $null
userIdentityType = "aadUser"
}
}
}
)
messageHistory = @(
@{
modifiedDateTime = [System.DateTime]::Parse("2018-10-21T08:10:30.489Z")
actions = "reactionAdded"
reaction = @{
reactionType = "angry"
user = @{
application = $null
device = $null
user = @{
id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e"
displayName = $null
userIdentityType = "aadUser"
}
}
}
}
@{
modifiedDateTime = [System.DateTime]::Parse("2018-10-21T08:10:32.489Z")
actions = "reactionAdded"
reaction = @{
reactionType = "laugh"
user = @{
application = $null
device = $null
user = @{
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
displayName = $null
userIdentityType = "aadUser"
}
}
}
}
@{
modifiedDateTime = [System.DateTime]::Parse("2018-10-21T02:17:14.67Z")
actions = "reactionAdded"
reaction = @{
reactionType = "like"
user = @{
application = $null
device = $null
user = @{
id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e"
displayName = $null
userIdentityType = "aadUser"
}
}
}
}
@{
modifiedDateTime = [System.DateTime]::Parse("2018-10-21T02:34:40.3Z")
actions = "reactionAdded"
reaction = @{
reactionType = "like"
user = @{
application = $null
device = $null
user = @{
id = "4c9041b7-449a-40f7-8855-56da239b9fd1"
displayName = $null
userIdentityType = "aadUser"
}
}
}
}
@{
modifiedDateTime = [System.DateTime]::Parse("2018-10-21T08:10:25.489Z")
actions = "reactionAdded"
reaction = @{
reactionType = "like"
user = @{
application = $null
device = $null
user = @{
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
displayName = $null
userIdentityType = "aadUser"
}
}
}
}
@{
modifiedDateTime = [System.DateTime]::Parse("2018-10-21T08:10:31.489Z")
actions = "reactionAdded"
reaction = @{
reactionType = "heart"
user = @{
application = $null
device = $null
user = @{
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
displayName = $null
userIdentityType = "aadUser"
}
}
}
}
@{
modifiedDateTime = [System.DateTime]::Parse("2018-10-21T08:10:33.489Z")
actions = "reactionAdded"
reaction = @{
reactionType = "sad"
user = @{
application = $null
device = $null
user = @{
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
displayName = $null
userIdentityType = "aadUser"
}
}
}
}
@{
modifiedDateTime = [System.DateTime]::Parse("2018-10-21T08:10:34.489Z")
actions = "surprised"
reaction = @{
reactionType = "sad"
user = @{
application = $null
device = $null
user = @{
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e"
displayName = $null
userIdentityType = "aadUser"
}
}
}
}
)
}
Update-MgBetaTeamChannelMessage -TeamId $teamId -ChannelId $channelId -ChatMessageId $chatMessageId -BodyParameter $params
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = ChatMessage(
message_type = ChatMessageType.Message,
subject = None,
summary = None,
importance = ChatMessageImportance.Normal,
locale = "en-us",
from = ChatMessageFromIdentitySet(
application = None,
device = None,
user = Identity(
id = "3b102402-813e-4e17-a6b2-f841aef1fdfc",
display_name = "Sumit Gupta",
additional_data = {
"user_identity_type" : "aadUser",
}
),
additional_data = {
"conversation" : None,
}
),
body = ItemBody(
content_type = BodyType.Html,
content = "<p><em>text</em></p><attachment id=\"e8f78756199240b88448ae0fc6db112d\"></attachment><attachment id=\"638464e32834471ea202007da60a5ae6\"></attachment>",
),
attachments = [
ChatMessageAttachment(
id = "e8f78756199240b88448ae0fc6db112d",
content_type = "application/vnd.microsoft.card.hero",
content_url = None,
content = "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"openUrl\",\r\n \"image\": \"https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fcdn2.iconfinder.com%2fdata%2ficons%2fsocial-icons-33%2f128%2fTrello-128.png\",\r\n \"title\": \"😃😃 click me 😃😃\",\r\n \"value\": \"http://microsoft.com\"\r\n },\r\n {\r\n \"type\": \"imback\",\r\n \"title\": \"&i am back& <>= \"\",\r\n \"value\": \"&i am back& <>= \"\"\r\n },\r\n {\r\n \"type\": \"openUrl\",\r\n \"title\": \"Open URL\",\r\n \"value\": \"http://google.com\"\r\n }\r\n ]\r\n}",
name = None,
thumbnail_url = None,
),
ChatMessageAttachment(
id = "638464e32834471ea202007da60a5ae6",
content_type = "application/vnd.microsoft.card.hero",
content_url = None,
content = "{\r\n \"title\": \"*title*\",\r\n \"subtitle\": \"*subtitle*\",\r\n \"text\": \"Have you found yourself scratching your head trying to figure these questions out? Frustrated trying to access some of the goodies unique to the Microsoft Teams platform? Well, fear not, Bot Builder SDK Extension for Teams in .NET and Node flavors is here! Just head on over to Nuget or NPM to download our tasty helpers, sure to speed up your prep time so you can spend more time maximizing the flavor of the bots you're cooking up.Here’s a small sample of some recipes to whet your appetite.\",\r\n \"images\": [\r\n {\r\n \"url\": \"https://us-api.asm.skype.com/v1/objects/0-eus-d8-ced0c9567ee7b0b233b987bd32f9eacd/views/img_preview\"\r\n }\r\n ],\r\n \"buttons\": [\r\n {\r\n \"type\": \"messageBack\",\r\n \"title\": \"&message back& <>= \"\",\r\n \"text\": \"text = &message back& <>= \"\",\r\n \"displayText\": \"displayText = &message back& <>= \"\",\r\n \"value\": {\r\n \"text\": \"some text 2\"\r\n }\r\n }\r\n ]\r\n}",
name = None,
thumbnail_url = None,
),
]
mentions = [
]
reactions = [
ChatMessageReaction(
reaction_type = "angry",
created_date_time = "2018-10-21T08:10:30.489Z",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
ChatMessageReaction(
reaction_type = "laugh",
created_date_time = "2018-10-21T08:10:32.489Z",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
ChatMessageReaction(
reaction_type = "like",
created_date_time = "2018-10-21T02:17:14.67Z",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
ChatMessageReaction(
reaction_type = "like",
created_date_time = "2018-10-21T02:34:40.3Z",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "4c9041b7-449a-40f7-8855-56da239b9fd1",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
ChatMessageReaction(
reaction_type = "like",
created_date_time = "2018-10-21T08:10:25.489Z",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
ChatMessageReaction(
reaction_type = "heart",
created_date_time = "2018-10-21T08:10:31.489Z",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
ChatMessageReaction(
reaction_type = "sad",
created_date_time = "2018-10-21T08:10:33.489Z",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
ChatMessageReaction(
reaction_type = "surprised",
created_date_time = "2018-10-21T08:10:34.489Z",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
]
message_history = [
ChatMessageHistoryItem(
modified_date_time = "2018-10-21T08:10:30.489Z",
actions = ChatMessageActions.ReactionAdded,
reaction = ChatMessageReaction(
reaction_type = "angry",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
),
ChatMessageHistoryItem(
modified_date_time = "2018-10-21T08:10:32.489Z",
actions = ChatMessageActions.ReactionAdded,
reaction = ChatMessageReaction(
reaction_type = "laugh",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
),
ChatMessageHistoryItem(
modified_date_time = "2018-10-21T02:17:14.67Z",
actions = ChatMessageActions.ReactionAdded,
reaction = ChatMessageReaction(
reaction_type = "like",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "f1b66449-b46d-49b0-9c3c-53c10a5c818e",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
),
ChatMessageHistoryItem(
modified_date_time = "2018-10-21T02:34:40.3Z",
actions = ChatMessageActions.ReactionAdded,
reaction = ChatMessageReaction(
reaction_type = "like",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "4c9041b7-449a-40f7-8855-56da239b9fd1",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
),
ChatMessageHistoryItem(
modified_date_time = "2018-10-21T08:10:25.489Z",
actions = ChatMessageActions.ReactionAdded,
reaction = ChatMessageReaction(
reaction_type = "like",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
),
ChatMessageHistoryItem(
modified_date_time = "2018-10-21T08:10:31.489Z",
actions = ChatMessageActions.ReactionAdded,
reaction = ChatMessageReaction(
reaction_type = "heart",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
),
ChatMessageHistoryItem(
modified_date_time = "2018-10-21T08:10:33.489Z",
actions = ChatMessageActions.ReactionAdded,
reaction = ChatMessageReaction(
reaction_type = "sad",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
),
ChatMessageHistoryItem(
modified_date_time = "2018-10-21T08:10:34.489Z",
actions = ChatMessageActions.ReactionAdded,
reaction = ChatMessageReaction(
reaction_type = "sad",
user = ChatMessageReactionIdentitySet(
application = None,
device = None,
user = Identity(
id = "03a02232-d8f5-4970-a77e-6e8c76ce7a4e",
display_name = None,
additional_data = {
"user_identity_type" : "aadUser",
}
),
),
),
),
]
)
result = await graph_client.teams.by_team_id('team-id').channels.by_channel_id('channel-id').messages.by_message_id('chatMessage-id').patch(body = request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
Here is an example of the response.
HTTP/1.1 204 NoContent
Feedback
Submit and view feedback for