PostMessage¶
Posts a new message to a channel.
1 | |
The display name of the attachment.
ext : ( ... | ... )
The file extension, if the attachment is a file type.
id : ( ... | ... )
The ID of the attachment. Optional.
type : ( ... | ... | ... )
The type of attachment.
url : ( ... | ... )
The URL of the attachment, if it is a URL type.>
An array of attachments for the message.
Content : string
The content of the message. Optional. This is the same as
Description : string
The description of the message. Optional.
Id : string
The ID of the message. Optional. Must be a string with a maximum length of 1024 characters.
References : Array
An array of IDs referencing previously sent messages. Optional.
Subject : string
The subject of the message. Optional.):Case : Case
The instance of the
Id : string
The ID of the activity message. This may be a new ID if a message with the given ID does not exist.
IsNew : boolean
A value indicating whether the message is new (not seen before).
Parameters¶
string channelId
The ID of the channel to post the message to.
Attachments : Array<displayName : ( ... | ... )
The display name of the attachment.
ext : ( ... | ... )
The file extension, if the attachment is a file type.
id : ( ... | ... )
The ID of the attachment. Optional.
type : ( ... | ... | ... )
The type of attachment.
url : ( ... | ... )
The URL of the attachment, if it is a URL type.>
An array of attachments for the message.
Content : string
The content of the message. Optional. This is the same as
Description : string
The description of the message. Optional.
Id : string
The ID of the message. Optional. Must be a string with a maximum length of 1024 characters.
References : Array
An array of IDs referencing previously sent messages. Optional.
Subject : string
The subject of the message. Optional. msg
The message properties.
Returns¶
A ChannelMessageResult instance containing the results of the operation.
Remarks¶
This method performs different actions depending on whether the given input has an Id property:
- If no
Idis specified, it simply posts a new activity message on the channel with the given subject and content. This is useful for notification purposes. - When an
Idis given, the method first checks if a message with the specifiedIdwas previously sent on the channel. If a previously sent message is found, it does not create a new activity and returns the existing Case instance. - If the input contains a
referencesproperty, it also checks for previously sent messages with the referenced IDs. If any reference is found, it creates a new activity that is linked to the matching case and returns the existing Case instance. - When nothing matches, it creates a new Case on the channel with the activity and returns it.
- If case management is not enabled on the channel, it always posts a new activity on the channel without a Case instance.
Create an activity¶
1 2 3 4 | |
Create a case¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
See Also¶
$Domain.CreateCaseCase: Case
The instance of the
Id : string
The ID of the activity message. This may be a new ID if a message with the given ID does not exist.
IsNew : boolean
A value indicating whether the message is new (not seen before). * ChannelMessageResult * Case * ChannelMessage.Description