New-MgChatMessage
Send a new chatMessage in the specified chat. This API can't create a new chat; you must use the list chats method to retrieve the ID of an existing chat before you can create a chat message.
Note
To view the beta release of this cmdlet, view New-MgBetaChatMessage
Syntax
New-MgChatMessage
-ChatId <String>
[-ResponseHeadersVariable <String>]
[-AdditionalProperties <Hashtable>]
[-Attachments <IMicrosoftGraphChatMessageAttachment[]>]
[-Body <IMicrosoftGraphItemBody>]
[-ChannelIdentity <IMicrosoftGraphChannelIdentity>]
[-ChatId1 <String>]
[-CreatedDateTime <DateTime>]
[-DeletedDateTime <DateTime>]
[-Etag <String>]
[-EventDetail <Hashtable>]
[-From <Hashtable>]
[-HostedContents <IMicrosoftGraphChatMessageHostedContent[]>]
[-Id <String>]
[-Importance <String>]
[-LastEditedDateTime <DateTime>]
[-LastModifiedDateTime <DateTime>]
[-Locale <String>]
[-Mentions <IMicrosoftGraphChatMessageMention[]>]
[-MessageHistory <IMicrosoftGraphChatMessageHistoryItem[]>]
[-MessageType <String>]
[-PolicyViolation <IMicrosoftGraphChatMessagePolicyViolation>]
[-Reactions <IMicrosoftGraphChatMessageReaction[]>]
[-Replies <IMicrosoftGraphChatMessage[]>]
[-ReplyToId <String>]
[-Subject <String>]
[-Summary <String>]
[-WebUrl <String>]
[-Headers <IDictionary>]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-MgChatMessage
[-ChatId <String>]
-InputObject <ITeamsIdentity>
[-ResponseHeadersVariable <String>]
[-AdditionalProperties <Hashtable>]
[-Attachments <IMicrosoftGraphChatMessageAttachment[]>]
[-Body <IMicrosoftGraphItemBody>]
[-ChannelIdentity <IMicrosoftGraphChannelIdentity>]
[-CreatedDateTime <DateTime>]
[-DeletedDateTime <DateTime>]
[-Etag <String>]
[-EventDetail <Hashtable>]
[-From <Hashtable>]
[-HostedContents <IMicrosoftGraphChatMessageHostedContent[]>]
[-Id <String>]
[-Importance <String>]
[-LastEditedDateTime <DateTime>]
[-LastModifiedDateTime <DateTime>]
[-Locale <String>]
[-Mentions <IMicrosoftGraphChatMessageMention[]>]
[-MessageHistory <IMicrosoftGraphChatMessageHistoryItem[]>]
[-MessageType <String>]
[-PolicyViolation <IMicrosoftGraphChatMessagePolicyViolation>]
[-Reactions <IMicrosoftGraphChatMessageReaction[]>]
[-Replies <IMicrosoftGraphChatMessage[]>]
[-ReplyToId <String>]
[-Subject <String>]
[-Summary <String>]
[-WebUrl <String>]
[-Headers <IDictionary>]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-MgChatMessage
-ChatId <String>
-BodyParameter <IMicrosoftGraphChatMessage>
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-MgChatMessage
-InputObject <ITeamsIdentity>
-BodyParameter <IMicrosoftGraphChatMessage>
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Send a new chatMessage in the specified chat. This API can't create a new chat; you must use the list chats method to retrieve the ID of an existing chat before you can create a chat message.
Permissions
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | ChannelMessage.Send | Group.ReadWrite.All |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | Teamwork.Migrate.All | Not available. |
Examples
Example 1: Send inline images along with the message
Import-Module Microsoft.Graph.Teams
$params = @{
body = @{
contentType = "html"
content = "<div><div>
<div><span><img height="297" src="../hostedContents/1/$value" width="297" style="vertical-align:bottom; width:297px; height:297px"></span>
</div>
</div>
</div>"
}
hostedContents = @(
@{
"@microsoft.graph.temporaryId" = "1"
contentBytes = [System.Text.Encoding]::ASCII.GetBytes("iVBORw0KGgoAAAANSUhEUgAAASkAAAEpCAYAAADPmdSCAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZ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qzHXCHB57/9Jez4vxb5skZ7b+Yb9Y1N0NUlvskDmuNRpan/VAf/rTn7ZCCrf8Zc89JroVcRr4i5HVdw3Mf9MvgYht/WP+APZEoxE6ZA0XEPfV9VQGyxjwByE1xgnzmCbQ++u4GBrLnBp/3TsCahSLN9cJA3fMpzAB+7Cgibffftv6xEchNYZFruv0PTWWTp/q4VujWn2DMkIKd9pkTzYqGLgJJviq0OVTPsxFhT8XLlygzztGrBbSTMu5KBw97bHuRYNoldHPRwU4MpjCfFTQZr4Fn+gt/nn11Vfpc46RxwXaU4D+1fCsBFNJx6xb0QBqAiFV5d0Ouqj5bgdtNb1MBgH14YcfWl+49ec3v/kNfc4x0lKE9hoGFMIJNypodWrHIKTYC4xSx08hqtRkUhhBFgcU/rzxxhv0OcdIk+ft4Mjzj3/84/+xWs5hvSUWhvcOp0AhNVKrBt9TTz01e+WVV2z/8z/vvPMOfc4x0p07m8H6whVnIjhqwrRR40/s2lBIjRTu8BB3NIQTJsjff/992/fL/0wppHT7ltUQTpjL/cMf/vC3qHaYCMcndZ0mw9uYVEhdvXqVto8RAhmnc4Cjpt/97ne2v5v9UUhNExYB43QOfvzjH7//+uuvv2undn+x/vCa1QqBhJUA7qF0u9nH/h+sBaOnOz4IxQAAAABJRU5ErkJggg==")
contentType = "image/png"
}
)
}
New-MgChatMessage -ChatId $chatId -BodyParameter $params
This example will send inline images along with the message
Example 2: Send a message with an emoji
Import-Module Microsoft.Graph.Teams
$params = @{
body = @{
contentType = "html"
content = "<emoji alt="πΆβπ«οΈ"></emoji>"
}
}
New-MgChatMessage -ChatId $chatId -BodyParameter $params
This example will### Example 2: send a message with an emoji
PARAMETERS
-AdditionalProperties
Additional Parameters
Type: Hashtable
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Attachments
References to attached objects like files, tabs, meetings etc. To construct, see NOTES section for ATTACHMENTS properties and create a hash table.
Type: IMicrosoftGraphChatMessageAttachment[]
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Body
itemBody To construct, see NOTES section for BODY properties and create a hash table.
Type: IMicrosoftGraphItemBody
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-BodyParameter
chatMessage To construct, see NOTES section for BODYPARAMETER properties and create a hash table.
Type: IMicrosoftGraphChatMessage
Parameter Sets: Create, CreateViaIdentity
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-ChannelIdentity
channelIdentity To construct, see NOTES section for CHANNELIDENTITY properties and create a hash table.
Type: IMicrosoftGraphChannelIdentity
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ChatId
The unique identifier of chat
Type: String
Parameter Sets: CreateExpanded, Create
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: String
Parameter Sets: CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ChatId1
If the message was sent in a chat, represents the identity of the chat.
Type: String
Parameter Sets: CreateExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-CreatedDateTime
Timestamp of when the chat message was created.
Type: DateTime
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-DeletedDateTime
Read only. Timestamp at which the chat message was deleted, or null if not deleted.
Type: DateTime
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Etag
Read-only. Version number of the chat message.
Type: String
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-EventDetail
eventMessageDetail
Type: Hashtable
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-From
chatMessageFromIdentitySet
Type: Hashtable
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Headers
Optional headers that will be added to the request.
Type: IDictionary
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-HostedContents
Content in a message hosted by Microsoft Teams - for example, images or code snippets. To construct, see NOTES section for HOSTEDCONTENTS properties and create a hash table.
Type: IMicrosoftGraphChatMessageHostedContent[]
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Id
The unique identifier for an entity. Read-only.
Type: String
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Importance
chatMessageImportance
Type: String
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-InputObject
Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
Type: ITeamsIdentity
Parameter Sets: CreateViaIdentityExpanded, CreateViaIdentity
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-LastEditedDateTime
Read only. Timestamp when edits to the chat message were made. Triggers an 'Edited' flag in the Teams UI. If no edits are made the value is null.
Type: DateTime
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-LastModifiedDateTime
Read only. Timestamp when the chat message is created (initial setting) or modified, including when a reaction is added or removed.
Type: DateTime
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Locale
Locale of the chat message set by the client. Always set to en-us.
Type: String
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Mentions
List of entities mentioned in the chat message. Supported entities are: user, bot, team, and channel. To construct, see NOTES section for MENTIONS properties and create a hash table.
Type: IMicrosoftGraphChatMessageMention[]
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-MessageHistory
List of activity history of a message item, including modification time and actions, such as reactionAdded, reactionRemoved, or reaction changes, on the message. To construct, see NOTES section for MESSAGEHISTORY properties and create a hash table.
Type: IMicrosoftGraphChatMessageHistoryItem[]
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-MessageType
chatMessageType
Type: String
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-PolicyViolation
chatMessagePolicyViolation To construct, see NOTES section for POLICYVIOLATION properties and create a hash table.
Type: IMicrosoftGraphChatMessagePolicyViolation
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Reactions
Reactions for this chat message (for example, Like). To construct, see NOTES section for REACTIONS properties and create a hash table.
Type: IMicrosoftGraphChatMessageReaction[]
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Replies
Replies for a specified message. Supports $expand for channel messages. To construct, see NOTES section for REPLIES properties and create a hash table.
Type: IMicrosoftGraphChatMessage[]
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ReplyToId
Read-only. ID of the parent chat message or root chat message of the thread. (Only applies to chat messages in channels, not chats.)
Type: String
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ResponseHeadersVariable
Optional Response Headers Variable.
Type: String
Parameter Sets: (All)
Aliases: RHV
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Subject
The subject of the chat message, in plaintext.
Type: String
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Summary
Summary text of the chat message that could be used for push notifications and summary views or fall back views. Only applies to channel chat messages, not chat messages in a chat.
Type: String
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WebUrl
Read-only. Link to the message in Microsoft Teams.
Type: String
Parameter Sets: CreateExpanded, CreateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
Microsoft.Graph.PowerShell.Models.IMicrosoftGraphChatMessage
Microsoft.Graph.PowerShell.Models.ITeamsIdentity
System.Collections.IDictionary
OUTPUTS
Microsoft.Graph.PowerShell.Models.IMicrosoftGraphChatMessage
NOTES
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
ATTACHMENTS <IMicrosoftGraphChatMessageAttachment- []
>: References to attached objects like files, tabs, meetings etc.
[Content <String>]
: The content of the attachment. If the attachment is a rich card, set the property to the rich card object. This property and contentUrl are mutually exclusive.[ContentType <String>]
: The media type of the content attachment. It can have the following values: reference: Attachment is a link to another file. Populate the contentURL with the link to the object.Any contentType that is supported by the Bot Framework's Attachment objectapplication/vnd.microsoft.card.codesnippet: A code snippet. application/vnd.microsoft.card.announcement: An announcement header.[ContentUrl <String>]
: The URL for the content of the attachment.[Id <String>]
: Read-only. The unique id of the attachment.[Name <String>]
: The name of the attachment.[TeamsAppId <String>]
: The ID of the Teams app that is associated with the attachment. The property is used to attribute a Teams message card to the specified app.[ThumbnailUrl <String>]
: The URL to a thumbnail image that the channel can use if it supports using an alternative, smaller form of content or contentUrl. For example, if you set contentType to application/word and set contentUrl to the location of the Word document, you might include a thumbnail image that represents the document. The channel could display the thumbnail image instead of the document. When the user selects the image, the channel would open the document.
BODY <IMicrosoftGraphItemBody>
: itemBody
[(Any) <Object>]
: This indicates any property can be added to this object.[Content <String>]
: The content of the item.[ContentType <String>]
: bodyType
BODYPARAMETER <IMicrosoftGraphChatMessage>
: chatMessage
[(Any) <Object>]
: This indicates any property can be added to this object.[Id <String>]
: The unique identifier for an entity. Read-only.[Attachments <IMicrosoftGraphChatMessageAttachment-
[]>]
: References to attached objects like files, tabs, meetings etc.[Content <String>]
: The content of the attachment. If the attachment is a rich card, set the property to the rich card object. This property and contentUrl are mutually exclusive.[ContentType <String>]
: The media type of the content attachment. It can have the following values: reference: Attachment is a link to another file. Populate the contentURL with the link to the object.Any contentType that is supported by the Bot Framework's Attachment objectapplication/vnd.microsoft.card.codesnippet: A code snippet. application/vnd.microsoft.card.announcement: An announcement header.[ContentUrl <String>]
: The URL for the content of the attachment.[Id <String>]
: Read-only. The unique id of the attachment.[Name <String>]
: The name of the attachment.[TeamsAppId <String>]
: The ID of the Teams app that is associated with the attachment. The property is used to attribute a Teams message card to the specified app.[ThumbnailUrl <String>]
: The URL to a thumbnail image that the channel can use if it supports using an alternative, smaller form of content or contentUrl. For example, if you set contentType to application/word and set contentUrl to the location of the Word document, you might include a thumbnail image that represents the document. The channel could display the thumbnail image instead of the document. When the user selects the image, the channel would open the document.
[Body <IMicrosoftGraphItemBody>]
: itemBody[(Any) <Object>]
: This indicates any property can be added to this object.[Content <String>]
: The content of the item.[ContentType <String>]
: bodyType
[ChannelIdentity <IMicrosoftGraphChannelIdentity>]
: channelIdentity[(Any) <Object>]
: This indicates any property can be added to this object.[ChannelId <String>]
: The identity of the channel in which the message was posted.[TeamId <String>]
: The identity of the team in which the message was posted.
[ChatId <String>]
: If the message was sent in a chat, represents the identity of the chat.[CreatedDateTime <DateTime?>]
: Timestamp of when the chat message was created.[DeletedDateTime <DateTime?>]
: Read only. Timestamp at which the chat message was deleted, or null if not deleted.[Etag <String>]
: Read-only. Version number of the chat message.[EventDetail <IMicrosoftGraphEventMessageDetail>]
: eventMessageDetail[(Any) <Object>]
: This indicates any property can be added to this object.
[From <IMicrosoftGraphChatMessageFromIdentitySet>]
: chatMessageFromIdentitySet[(Any) <Object>]
: This indicates any property can be added to this object.[Application <IMicrosoftGraphIdentity>]
: identity[(Any) <Object>]
: This indicates any property can be added to this object.[DisplayName <String>]
: The display name of the identity.For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta.[Id <String>]
: Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review.
[Device <IMicrosoftGraphIdentity>]
: identity[User <IMicrosoftGraphIdentity>]
: identity
[HostedContents <IMicrosoftGraphChatMessageHostedContent-
[]>]
: Content in a message hosted by Microsoft Teams - for example, images or code snippets.[ContentBytes <Byte-
[]>]
: Write only. Bytes for the hosted content (such as images).[ContentType <String>]
: Write only. Content type. such as image/png, image/jpg.[Id <String>]
: The unique identifier for an entity. Read-only.
[Importance <String>]
: chatMessageImportance[LastEditedDateTime <DateTime?>]
: Read only. Timestamp when edits to the chat message were made. Triggers an 'Edited' flag in the Teams UI. If no edits are made the value is null.[LastModifiedDateTime <DateTime?>]
: Read only. Timestamp when the chat message is created (initial setting) or modified, including when a reaction is added or removed.[Locale <String>]
: Locale of the chat message set by the client. Always set to en-us.[Mentions <IMicrosoftGraphChatMessageMention-
[]>]
: List of entities mentioned in the chat message. Supported entities are: user, bot, team, and channel.[Id <Int32?>]
: Index of an entity being mentioned in the specified chatMessage. Matches the {index} value in the corresponding<at id='{index}'>
tag in the message body.[MentionText <String>]
: String used to represent the mention. For example, a user's display name, a team name.[Mentioned <IMicrosoftGraphChatMessageMentionedIdentitySet>]
: chatMessageMentionedIdentitySet[(Any) <Object>]
: This indicates any property can be added to this object.[Application <IMicrosoftGraphIdentity>]
: identity[Device <IMicrosoftGraphIdentity>]
: identity[User <IMicrosoftGraphIdentity>]
: identity[Conversation <IMicrosoftGraphTeamworkConversationIdentity>]
: teamworkConversationIdentity[(Any) <Object>]
: This indicates any property can be added to this object.[DisplayName <String>]
: The display name of the identity.For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta.[Id <String>]
: Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review.[ConversationIdentityType <String>]
: teamworkConversationIdentityType
[MessageHistory <IMicrosoftGraphChatMessageHistoryItem-
[]>]
: List of activity history of a message item, including modification time and actions, such as reactionAdded, reactionRemoved, or reaction changes, on the message.[Actions <String>]
: chatMessageActions[ModifiedDateTime <DateTime?>]
: The date and time when the message was modified.[Reaction <IMicrosoftGraphChatMessageReaction>]
: chatMessageReaction[(Any) <Object>]
: This indicates any property can be added to this object.[CreatedDateTime <DateTime?>]
: The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z[ReactionType <String>]
: Supported values are like, angry, sad, laugh, heart, surprised.[User <IMicrosoftGraphChatMessageReactionIdentitySet>]
: chatMessageReactionIdentitySet[(Any) <Object>]
: This indicates any property can be added to this object.[Application <IMicrosoftGraphIdentity>]
: identity[Device <IMicrosoftGraphIdentity>]
: identity[User <IMicrosoftGraphIdentity>]
: identity
[MessageType <String>]
: chatMessageType[PolicyViolation <IMicrosoftGraphChatMessagePolicyViolation>]
: chatMessagePolicyViolation[(Any) <Object>]
: This indicates any property can be added to this object.[DlpAction <String>]
: chatMessagePolicyViolationDlpActionTypes[JustificationText <String>]
: Justification text provided by the sender of the message when overriding a policy violation.[PolicyTip <IMicrosoftGraphChatMessagePolicyViolationPolicyTip>]
: chatMessagePolicyViolationPolicyTip[(Any) <Object>]
: This indicates any property can be added to this object.[ComplianceUrl <String>]
: The URL a user can visit to read about the data loss prevention policies for the organization. (ie, policies about what users shouldn't say in chats)[GeneralText <String>]
: Explanatory text shown to the sender of the message.[MatchedConditionDescriptions <String-
[]>]
: The list of improper data in the message that was detected by the data loss prevention app. Each DLP app defines its own conditions, examples include 'Credit Card Number' and 'Social Security Number'.
[UserAction <String>]
: chatMessagePolicyViolationUserActionTypes[VerdictDetails <String>]
: chatMessagePolicyViolationVerdictDetailsTypes
[Reactions <IMicrosoftGraphChatMessageReaction-
[]>]
: Reactions for this chat message (for example, Like).[Replies <IMicrosoftGraphChatMessage-
[]>]
: Replies for a specified message. Supports $expand for channel messages.[ReplyToId <String>]
: Read-only. ID of the parent chat message or root chat message of the thread. (Only applies to chat messages in channels, not chats.)[Subject <String>]
: The subject of the chat message, in plaintext.[Summary <String>]
: Summary text of the chat message that could be used for push notifications and summary views or fall back views. Only applies to channel chat messages, not chat messages in a chat.[WebUrl <String>]
: Read-only. Link to the message in Microsoft Teams.
CHANNELIDENTITY <IMicrosoftGraphChannelIdentity>
: channelIdentity
[(Any) <Object>]
: This indicates any property can be added to this object.[ChannelId <String>]
: The identity of the channel in which the message was posted.[TeamId <String>]
: The identity of the team in which the message was posted.
HOSTEDCONTENTS <IMicrosoftGraphChatMessageHostedContent- []
>: Content in a message hosted by Microsoft Teams - for example, images or code snippets.
[ContentBytes <Byte-
[]>]
: Write only. Bytes for the hosted content (such as images).[ContentType <String>]
: Write only. Content type. such as image/png, image/jpg.[Id <String>]
: The unique identifier for an entity. Read-only.
INPUTOBJECT <ITeamsIdentity>
: Identity Parameter
[AssociatedTeamInfoId <String>]
: The unique identifier of associatedTeamInfo[ChannelId <String>]
: The unique identifier of channel[ChatId <String>]
: The unique identifier of chat[ChatMessageHostedContentId <String>]
: The unique identifier of chatMessageHostedContent[ChatMessageId <String>]
: The unique identifier of chatMessage[ChatMessageId1 <String>]
: The unique identifier of chatMessage[ConversationMemberId <String>]
: The unique identifier of conversationMember[DeletedChatId <String>]
: The unique identifier of deletedChat[DeletedTeamId <String>]
: The unique identifier of deletedTeam[GroupId <String>]
: The unique identifier of group[OfferShiftRequestId <String>]
: The unique identifier of offerShiftRequest[OpenShiftChangeRequestId <String>]
: The unique identifier of openShiftChangeRequest[OpenShiftId <String>]
: The unique identifier of openShift[PinnedChatMessageInfoId <String>]
: The unique identifier of pinnedChatMessageInfo[ResourceSpecificPermissionGrantId <String>]
: The unique identifier of resourceSpecificPermissionGrant[SchedulingGroupId <String>]
: The unique identifier of schedulingGroup[SharedWithChannelTeamInfoId <String>]
: The unique identifier of sharedWithChannelTeamInfo[ShiftId <String>]
: The unique identifier of shift[SwapShiftsChangeRequestId <String>]
: The unique identifier of swapShiftsChangeRequest[TeamId <String>]
: The unique identifier of team[TeamsAppDefinitionId <String>]
: The unique identifier of teamsAppDefinition[TeamsAppId <String>]
: The unique identifier of teamsApp[TeamsAppInstallationId <String>]
: The unique identifier of teamsAppInstallation[TeamsAsyncOperationId <String>]
: The unique identifier of teamsAsyncOperation[TeamsTabId <String>]
: The unique identifier of teamsTab[TeamworkTagId <String>]
: The unique identifier of teamworkTag[TeamworkTagMemberId <String>]
: The unique identifier of teamworkTagMember[TimeOffId <String>]
: The unique identifier of timeOff[TimeOffReasonId <String>]
: The unique identifier of timeOffReason[TimeOffRequestId <String>]
: The unique identifier of timeOffRequest[UserId <String>]
: The unique identifier of user[UserScopeTeamsAppInstallationId <String>]
: The unique identifier of userScopeTeamsAppInstallation[WorkforceIntegrationId <String>]
: The unique identifier of workforceIntegration
MENTIONS <IMicrosoftGraphChatMessageMention- []
>: List of entities mentioned in the chat message.
Supported entities are: user, bot, team, and channel.
[Id <Int32?>]
: Index of an entity being mentioned in the specified chatMessage. Matches the {index} value in the corresponding<at id='{index}'>
tag in the message body.[MentionText <String>]
: String used to represent the mention. For example, a user's display name, a team name.[Mentioned <IMicrosoftGraphChatMessageMentionedIdentitySet>]
: chatMessageMentionedIdentitySet[(Any) <Object>]
: This indicates any property can be added to this object.[Application <IMicrosoftGraphIdentity>]
: identity[(Any) <Object>]
: This indicates any property can be added to this object.[DisplayName <String>]
: The display name of the identity.For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta.[Id <String>]
: Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review.
[Device <IMicrosoftGraphIdentity>]
: identity[User <IMicrosoftGraphIdentity>]
: identity[Conversation <IMicrosoftGraphTeamworkConversationIdentity>]
: teamworkConversationIdentity[(Any) <Object>]
: This indicates any property can be added to this object.[DisplayName <String>]
: The display name of the identity.For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta.[Id <String>]
: Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review.[ConversationIdentityType <String>]
: teamworkConversationIdentityType
MESSAGEHISTORY <IMicrosoftGraphChatMessageHistoryItem- []
>: List of activity history of a message item, including modification time and actions, such as reactionAdded, reactionRemoved, or reaction changes, on the message.
[Actions <String>]
: chatMessageActions[ModifiedDateTime <DateTime?>]
: The date and time when the message was modified.[Reaction <IMicrosoftGraphChatMessageReaction>]
: chatMessageReaction[(Any) <Object>]
: This indicates any property can be added to this object.[CreatedDateTime <DateTime?>]
: The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z[ReactionType <String>]
: Supported values are like, angry, sad, laugh, heart, surprised.[User <IMicrosoftGraphChatMessageReactionIdentitySet>]
: chatMessageReactionIdentitySet[(Any) <Object>]
: This indicates any property can be added to this object.[Application <IMicrosoftGraphIdentity>]
: identity[(Any) <Object>]
: This indicates any property can be added to this object.[DisplayName <String>]
: The display name of the identity.For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta.[Id <String>]
: Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review.
[Device <IMicrosoftGraphIdentity>]
: identity[User <IMicrosoftGraphIdentity>]
: identity
POLICYVIOLATION <IMicrosoftGraphChatMessagePolicyViolation>
: chatMessagePolicyViolation
[(Any) <Object>]
: This indicates any property can be added to this object.[DlpAction <String>]
: chatMessagePolicyViolationDlpActionTypes[JustificationText <String>]
: Justification text provided by the sender of the message when overriding a policy violation.[PolicyTip <IMicrosoftGraphChatMessagePolicyViolationPolicyTip>]
: chatMessagePolicyViolationPolicyTip[(Any) <Object>]
: This indicates any property can be added to this object.[ComplianceUrl <String>]
: The URL a user can visit to read about the data loss prevention policies for the organization. (ie, policies about what users shouldn't say in chats)[GeneralText <String>]
: Explanatory text shown to the sender of the message.[MatchedConditionDescriptions <String-
[]>]
: The list of improper data in the message that was detected by the data loss prevention app. Each DLP app defines its own conditions, examples include 'Credit Card Number' and 'Social Security Number'.
[UserAction <String>]
: chatMessagePolicyViolationUserActionTypes[VerdictDetails <String>]
: chatMessagePolicyViolationVerdictDetailsTypes
REACTIONS <IMicrosoftGraphChatMessageReaction- []
>: Reactions for this chat message (for example, Like).
[CreatedDateTime <DateTime?>]
: The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z[ReactionType <String>]
: Supported values are like, angry, sad, laugh, heart, surprised.[User <IMicrosoftGraphChatMessageReactionIdentitySet>]
: chatMessageReactionIdentitySet[(Any) <Object>]
: This indicates any property can be added to this object.[Application <IMicrosoftGraphIdentity>]
: identity[(Any) <Object>]
: This indicates any property can be added to this object.[DisplayName <String>]
: The display name of the identity.For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta.[Id <String>]
: Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review.
[Device <IMicrosoftGraphIdentity>]
: identity[User <IMicrosoftGraphIdentity>]
: identity
REPLIES <IMicrosoftGraphChatMessage- []
>: Replies for a specified message.
Supports $expand for channel messages.
[Id <String>]
: The unique identifier for an entity. Read-only.[Attachments <IMicrosoftGraphChatMessageAttachment-
[]>]
: References to attached objects like files, tabs, meetings etc.[Content <String>]
: The content of the attachment. If the attachment is a rich card, set the property to the rich card object. This property and contentUrl are mutually exclusive.[ContentType <String>]
: The media type of the content attachment. It can have the following values: reference: Attachment is a link to another file. Populate the contentURL with the link to the object.Any contentType that is supported by the Bot Framework's Attachment objectapplication/vnd.microsoft.card.codesnippet: A code snippet. application/vnd.microsoft.card.announcement: An announcement header.[ContentUrl <String>]
: The URL for the content of the attachment.[Id <String>]
: Read-only. The unique id of the attachment.[Name <String>]
: The name of the attachment.[TeamsAppId <String>]
: The ID of the Teams app that is associated with the attachment. The property is used to attribute a Teams message card to the specified app.[ThumbnailUrl <String>]
: The URL to a thumbnail image that the channel can use if it supports using an alternative, smaller form of content or contentUrl. For example, if you set contentType to application/word and set contentUrl to the location of the Word document, you might include a thumbnail image that represents the document. The channel could display the thumbnail image instead of the document. When the user selects the image, the channel would open the document.
[Body <IMicrosoftGraphItemBody>]
: itemBody[(Any) <Object>]
: This indicates any property can be added to this object.[Content <String>]
: The content of the item.[ContentType <String>]
: bodyType
[ChannelIdentity <IMicrosoftGraphChannelIdentity>]
: channelIdentity[(Any) <Object>]
: This indicates any property can be added to this object.[ChannelId <String>]
: The identity of the channel in which the message was posted.[TeamId <String>]
: The identity of the team in which the message was posted.
[ChatId <String>]
: If the message was sent in a chat, represents the identity of the chat.[CreatedDateTime <DateTime?>]
: Timestamp of when the chat message was created.[DeletedDateTime <DateTime?>]
: Read only. Timestamp at which the chat message was deleted, or null if not deleted.[Etag <String>]
: Read-only. Version number of the chat message.[EventDetail <IMicrosoftGraphEventMessageDetail>]
: eventMessageDetail[(Any) <Object>]
: This indicates any property can be added to this object.
[From <IMicrosoftGraphChatMessageFromIdentitySet>]
: chatMessageFromIdentitySet[(Any) <Object>]
: This indicates any property can be added to this object.[Application <IMicrosoftGraphIdentity>]
: identity[(Any) <Object>]
: This indicates any property can be added to this object.[DisplayName <String>]
: The display name of the identity.For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta.[Id <String>]
: Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review.
[Device <IMicrosoftGraphIdentity>]
: identity[User <IMicrosoftGraphIdentity>]
: identity
[HostedContents <IMicrosoftGraphChatMessageHostedContent-
[]>]
: Content in a message hosted by Microsoft Teams - for example, images or code snippets.[ContentBytes <Byte-
[]>]
: Write only. Bytes for the hosted content (such as images).[ContentType <String>]
: Write only. Content type. such as image/png, image/jpg.[Id <String>]
: The unique identifier for an entity. Read-only.
[Importance <String>]
: chatMessageImportance[LastEditedDateTime <DateTime?>]
: Read only. Timestamp when edits to the chat message were made. Triggers an 'Edited' flag in the Teams UI. If no edits are made the value is null.[LastModifiedDateTime <DateTime?>]
: Read only. Timestamp when the chat message is created (initial setting) or modified, including when a reaction is added or removed.[Locale <String>]
: Locale of the chat message set by the client. Always set to en-us.[Mentions <IMicrosoftGraphChatMessageMention-
[]>]
: List of entities mentioned in the chat message. Supported entities are: user, bot, team, and channel.[Id <Int32?>]
: Index of an entity being mentioned in the specified chatMessage. Matches the {index} value in the corresponding<at id='{index}'>
tag in the message body.[MentionText <String>]
: String used to represent the mention. For example, a user's display name, a team name.[Mentioned <IMicrosoftGraphChatMessageMentionedIdentitySet>]
: chatMessageMentionedIdentitySet[(Any) <Object>]
: This indicates any property can be added to this object.[Application <IMicrosoftGraphIdentity>]
: identity[Device <IMicrosoftGraphIdentity>]
: identity[User <IMicrosoftGraphIdentity>]
: identity[Conversation <IMicrosoftGraphTeamworkConversationIdentity>]
: teamworkConversationIdentity[(Any) <Object>]
: This indicates any property can be added to this object.[DisplayName <String>]
: The display name of the identity.For drive items, the display name might not always be available or up to date. For example, if a user changes their display name the API might show the new value in a future response, but the items associated with the user don't show up as changed when using delta.[Id <String>]
: Unique identifier for the identity or actor. For example, in the access reviews decisions API, this property might record the id of the principal, that is, the group, user, or application that's subject to review.[ConversationIdentityType <String>]
: teamworkConversationIdentityType
[MessageHistory <IMicrosoftGraphChatMessageHistoryItem-
[]>]
: List of activity history of a message item, including modification time and actions, such as reactionAdded, reactionRemoved, or reaction changes, on the message.[Actions <String>]
: chatMessageActions[ModifiedDateTime <DateTime?>]
: The date and time when the message was modified.[Reaction <IMicrosoftGraphChatMessageReaction>]
: chatMessageReaction[(Any) <Object>]
: This indicates any property can be added to this object.[CreatedDateTime <DateTime?>]
: The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z[ReactionType <String>]
: Supported values are like, angry, sad, laugh, heart, surprised.[User <IMicrosoftGraphChatMessageReactionIdentitySet>]
: chatMessageReactionIdentitySet[(Any) <Object>]
: This indicates any property can be added to this object.[Application <IMicrosoftGraphIdentity>]
: identity[Device <IMicrosoftGraphIdentity>]
: identity[User <IMicrosoftGraphIdentity>]
: identity
[MessageType <String>]
: chatMessageType[PolicyViolation <IMicrosoftGraphChatMessagePolicyViolation>]
: chatMessagePolicyViolation[(Any) <Object>]
: This indicates any property can be added to this object.[DlpAction <String>]
: chatMessagePolicyViolationDlpActionTypes[JustificationText <String>]
: Justification text provided by the sender of the message when overriding a policy violation.[PolicyTip <IMicrosoftGraphChatMessagePolicyViolationPolicyTip>]
: chatMessagePolicyViolationPolicyTip[(Any) <Object>]
: This indicates any property can be added to this object.[ComplianceUrl <String>]
: The URL a user can visit to read about the data loss prevention policies for the organization. (ie, policies about what users shouldn't say in chats)[GeneralText <String>]
: Explanatory text shown to the sender of the message.[MatchedConditionDescriptions <String-
[]>]
: The list of improper data in the message that was detected by the data loss prevention app. Each DLP app defines its own conditions, examples include 'Credit Card Number' and 'Social Security Number'.
[UserAction <String>]
: chatMessagePolicyViolationUserActionTypes[VerdictDetails <String>]
: chatMessagePolicyViolationVerdictDetailsTypes
[Reactions <IMicrosoftGraphChatMessageReaction-
[]>]
: Reactions for this chat message (for example, Like).[Replies <IMicrosoftGraphChatMessage-
[]>]
: Replies for a specified message. Supports $expand for channel messages.[ReplyToId <String>]
: Read-only. ID of the parent chat message or root chat message of the thread. (Only applies to chat messages in channels, not chats.)[Subject <String>]
: The subject of the chat message, in plaintext.[Summary <String>]
: Summary text of the chat message that could be used for push notifications and summary views or fall back views. Only applies to channel chat messages, not chat messages in a chat.[WebUrl <String>]
: Read-only. Link to the message in Microsoft Teams.
RELATED LINKS
https://learn.microsoft.com/powershell/module/microsoft.graph.teams/new-mgchatmessage
https://learn.microsoft.com/graph/api/chat-post-messages?view=graph-rest-1.0