Class: MessageContext

Twilio.Chat.V2.ServiceContext.ChannelContext.MessageContext(version, serviceSid, channelSid, sid)

new MessageContext(version, serviceSid, channelSid, sid)

Initialize the MessageContext
Parameters:
Name Type Description
version V2 Version of the resource
serviceSid sid The SID of the Service to fetch the resource from
channelSid sid_like The SID of the Channel the message to fetch belongs to
sid sid The SID of the Message resource to fetch
Source:

Methods

fetch(callbackopt) → {Promise}

fetch a MessageInstance
Parameters:
Name Type Attributes Description
callback function <optional>
Callback to handle processed record
Source:
Returns:
Resolves to processed MessageInstance
Type
Promise

remove(optsopt, callbackopt) → {Promise}

remove a MessageInstance
Parameters:
Name Type Attributes Description
opts object <optional>
Options for request
Properties
Name Type Attributes Description
xTwilioWebhookEnabled message.webhook_enabled_type <optional>
The X-Twilio-Webhook-Enabled HTTP request header
callback function <optional>
Callback to handle processed record
Source:
Returns:
Resolves to processed MessageInstance
Type
Promise

toJSON()

Provide a user-friendly representation
Source:
Returns:
Object

update(optsopt, callbackopt) → {Promise}

update a MessageInstance
Parameters:
Name Type Attributes Description
opts object <optional>
Options for request
Properties
Name Type Attributes Description
body string <optional>
The message to send to the channel
attributes string <optional>
A valid JSON string that contains application-specific data
dateCreated Date <optional>
The ISO 8601 date and time in GMT when the resource was created
dateUpdated Date <optional>
The ISO 8601 date and time in GMT when the resource was updated
lastUpdatedBy string <optional>
The Identity of the User who last updated the Message, if applicable
from string <optional>
The Identity of the message's author
xTwilioWebhookEnabled message.webhook_enabled_type <optional>
The X-Twilio-Webhook-Enabled HTTP request header
callback function <optional>
Callback to handle processed record
Source:
Returns:
Resolves to processed MessageInstance
Type
Promise