Magidoc

insertMessage
Mutation

Creates a new message in a container (group, action, note, goal, or post).

Access: Requires user access to the container

Parameters:

  • _id: Random ID
  • containerId: ID of the container (id of group, action, note, goal, or post)
  • containerType: Type of the container (group, action, note, goal, or post). You should always specify this parameter to avoid errors and confusion.
  • body: Message text
  • mentions: Array of mentioned user IDs (that are mentioned like @username)
  • attachments: Array of file attachments
  • userMentionsByGroup: Array of mentioned group IDs
  • userMentionsByTeam: Array of mentioned team IDs

Examples:

  • Creating a message in a chat: insertMessage( _id containerId - Group ID containerType - 'group' body mentions attachments )
  • Creating a comment in an action: insertMessage( _id containerId - Action ID containerType - 'action' body mentions attachments )

Returns the created message with all computed fields.

Arguments

#

_id

containerId

containerType = "group"

body

Non-null

mentions = []

attachments = []

isNoteJsonComment

isPrivate

userMentionsByGroup = []

[ ID !]

Response

#

Returns Message !.

Example

#

    
  

3

    
  

3

    
  

3