Options
All
  • Public
  • Public/Protected
  • All
Menu

A message in a conversation.

Hierarchy

  • ReplayEventEmitter<MessageEvents>
    • Message

Index

Properties

Readonly conversation

conversation: Conversation

Conversation that the message is in.

Static Readonly updated

updated: "updated" = 'updated'

Fired when the properties or the body of the message has been updated.

Parameters:

  1. object data - info object provided with the event. It has the following properties:

Accessors

aggregatedDeliveryReceipt

  • Aggregated information about the message delivery statuses across all participants of a conversation..

    Returns AggregatedDeliveryReceipt

attachedMedia

  • get attachedMedia(): Media[]
  • Return all media attachments, except email body/history attachments, without temporary urls.

    Returns Media[]

attributes

  • get attributes(): Object
  • Custom attributes of the message.

    Returns Object

author

  • get author(): string
  • Name of the user that sent the message.

    Returns string

body

  • get body(): string
  • Body of the message.

    Returns string

dateCreated

  • get dateCreated(): Date
  • Date this message was created on.

    Returns Date

dateUpdated

  • get dateUpdated(): Date
  • Date this message was last updated on.

    Returns Date

index

  • get index(): number
  • Index of the message in the conversation's messages list. By design of the Conversations system, the message indices may have arbitrary gaps between them, that does not necessarily mean they were deleted or otherwise modified - just that messages may have some non-contiguous indices even if they are being sent immediately one after another.

    Trying to use indices for some calculations is going to be unreliable.

    To calculate the number of unread messages it is better to use the read horizon API. See Conversation.getUnreadMessagesCount for details.

    Returns number

lastUpdatedBy

  • get lastUpdatedBy(): string
  • Identity of the last user that updated the message.

    Returns string

media

  • One of the attached media.

    deprecated

    Use attachedMedia instead. Note that the latter is now an array.

    Returns Media

participantSid

  • get participantSid(): string
  • The server-assigned unique identifier of the authoring participant.

    Returns string

sid

  • get sid(): string
  • The server-assigned unique identifier for the message.

    Returns string

subject

  • get subject(): string
  • Message subject. Used only in email conversations.

    Returns string

type

  • Push notification type of the message.

    Returns MessageType

Methods

attachTemporaryUrlsFor

  • attachTemporaryUrlsFor(contentSet: Media[]): Promise<Media[]>
  • Get content URLs for all media attachments in the given set using single operation.

    Parameters

    • contentSet: Media[]

      Set of media attachments to query for content URL.

    Returns Promise<Media[]>

getDetailedDeliveryReceipts

getMediaByCategory

  • getMediaByCategory(categories: MediaCategory[]): Media[]
  • Return a (possibly empty) array of media matching a specific set of categories. Allowed category is so far only 'media'.

    Parameters

    • categories: MediaCategory[]

      Array of categories to match.

    Returns Media[]

    Array of media descriptors matching given categories.

getParticipant

  • Get the participant who is the author of the message.

    Returns Promise<Participant>

remove

  • Remove the message.

    Returns Promise<Message>

updateAttributes

  • updateAttributes(attributes: any): Promise<Message>
  • Edit the message attributes.

    Parameters

    • attributes: any

      New attributes.

    Returns Promise<Message>

updateBody

  • updateBody(body: string): Promise<Message>
  • Edit the message body.

    Parameters

    • body: string

      New body of the message.

    Returns Promise<Message>