The update only works for chats where members are Microsoft Teams users. If one of the participants is using Skype, the operation will fail.
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.
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
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.
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.
The following is an example of the response.
The following is an example of the request to update the properties on a Microsoft Teams channel message by using delegated permissions.
The following is an example of the response.
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/v1.0/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": "Lam Cong",
"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": "Lam Cong",
"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": []
}
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: 'Lam Cong',
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: 'Lam Cong',
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: []
};
await client.api('/teams/e1234567-e123-4276-55555-6232b0e3a89a/channels/a7654321-e321-0000-0000-123b0e3a00a/messages/19:a21b0b0c05194ebc9e30000000000f61@thread.skype')
.update(chatMessage);
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 = "Lam Cong";
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 = "Lam Cong";
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;
graphClient.teams("e1234567-e123-4276-55555-6232b0e3a89a").channels("a7654321-e321-0000-0000-123b0e3a00a").messages("19:a21b0b0c05194ebc9e30000000000f61@thread.skype")
.buildRequest()
.patch(chatMessage);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-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 := "Lam Cong"
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 := "Lam Cong"
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)
result, err := graphClient.TeamsById("team-id").ChannelsById("channel-id").MessagesById("chatMessage-id").Patch(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.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 = "Lam Cong"
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 = "Lam Cong"
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 = @(
)
}
Update-MgTeamChannelMessage -TeamId $teamId -ChannelId $channelId -ChatMessageId $chatMessageId -BodyParameter $params
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 FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$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('Lam Cong');
$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('Lam Cong');
$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([]);
$requestResult = $graphServiceClient->teamsById('team-id')->channelsById('channel-id')->messagesById('chatMessage-id')->patch($requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
The following is an example of the response.
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/v1.0/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": "Lam Cong",
"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": []
}
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: 'Lam Cong',
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: []
};
await client.api('/teams/e1234567-e123-4276-55555-6232b0e3a89a/channels/a7654321-e321-0000-0000-123b0e3a00a/messages/19:a21b0b0c05194ebc9e30000000000f61@thread.skype')
.update(chatMessage);
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 = "Lam Cong";
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;
graphClient.teams("e1234567-e123-4276-55555-6232b0e3a89a").channels("a7654321-e321-0000-0000-123b0e3a00a").messages("19:a21b0b0c05194ebc9e30000000000f61@thread.skype")
.buildRequest()
.patch(chatMessage);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-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 := "Lam Cong"
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)
result, err := graphClient.TeamsById("team-id").ChannelsById("channel-id").MessagesById("chatMessage-id").Patch(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.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 = "Lam Cong"
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 = @(
)
}
Update-MgTeamChannelMessage -TeamId $teamId -ChannelId $channelId -ChatMessageId $chatMessageId -BodyParameter $params
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 FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$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('Lam Cong');
$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([]);
$requestResult = $graphServiceClient->teamsById('team-id')->channelsById('channel-id')->messagesById('chatMessage-id')->patch($requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
The following is an example of the response.
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/v1.0/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": "Lam Cong",
"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"
}
}
}
]
}
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: 'Lam Cong',
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'
}
}
}
]
};
await client.api('/teams/e1234567-e123-4276-55555-6232b0e3a89a/channels/a7654321-e321-0000-0000-123b0e3a00a/messages/19:a21b0b0c05194ebc9e30000000000f61@thread.skype')
.update(chatMessage);
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 = "Lam Cong";
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;
graphClient.teams("e1234567-e123-4276-55555-6232b0e3a89a").channels("a7654321-e321-0000-0000-123b0e3a00a").messages("19:a21b0b0c05194ebc9e30000000000f61@thread.skype")
.buildRequest()
.patch(chatMessage);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-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 := "Lam Cong"
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)
result, err := graphClient.TeamsById("team-id").ChannelsById("channel-id").MessagesById("chatMessage-id").Patch(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.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 = "Lam Cong"
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"
}
}
}
)
}
Update-MgTeamChannelMessage -TeamId $teamId -ChannelId $channelId -ChatMessageId $chatMessageId -BodyParameter $params
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 FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$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('Lam Cong');
$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);
$requestResult = $graphServiceClient->teamsById('team-id')->channelsById('channel-id')->messagesById('chatMessage-id')->patch($requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
The following is an example of the response.