Chat / Platform API
Current version: v3
    Chat Platform API v3
    Chat Platform API
    Chat
    Platform API
    Home
    /
    Chat
    /
    Platform API
    /
    Message

    Update a message

    Updates specific information on a message.


    HTTP request

    PUT https://api-{application_id}.sendbird.com/v3/{channel_type}/{channel_url}/messages/{message_id}
    

    Parameters

    The following table lists the parameters that this action supports.

    Required
    Parameter nameTypeDescription

    channel_type

    string

    Specifies the type of the channel. Acceptable values are open_channels and group_channels.

    channel_url

    string

    Specifies the URL of the target channel.

    message_id

    long

    Specifies the unique ID of the message to update.


    Request body

    The following tables list the properties of an HTTP request that this action supports for updating a text message, file message, and admin message.

    List of properties for updating a text message

    RequiredTypeDescription

    message_type

    string

    Specifies the type of the message. The value of MESG represents a text message.

    OptionalTypeDescription

    message

    string

    Specifies the content of the message.

    custom_type

    string

    Specifies a custom message type used for message grouping. The length is limited to 128 characters.

    * Custom types are also used to segment metrics within Sendbird's Advanced analytics, which enables the sub-classification of data views.

    data

    string

    Specifies additional message information such as custom font size, font type, or JSON formatted string.

    mention_type

    string

    Specifies whether to mention specific users or all users in the channel. Acceptable values are users and channels. If set to users, up to ten users in the mentioned_user_ids property below are notified of the mention. If set to channels, up to ten users in the channel are notified of the mention. (Default: users)

    mentioned_user_ids[]

    array of strings

    Specifies an array of IDs of the users to mention in the message. This property is used only when mention_type is users.

    List of properties for updating a file message

    Properties
    RequiredTypeDescription

    message_type

    string

    Specifies the type of the message. The value of FILE represents a file message.

    OptionalTypeDescription

    custom_type

    string

    Specifies a custom message type used for message grouping. The length is limited to 128 characters.

    * Custom types are also used within Sendbird's Advanced analytics to segment metrics, which enables the sub-classification of data views.

    data

    string

    Specifies additional message information regarding the file in JSON format.

    mention_type

    string

    Specifies whether to mention specific users or all users in the channel. Acceptable values are users and channels. If set to users, up to ten users in the mentioned_user_ids property below are notified of the mention. If set to channels, up to ten users in the channel are notified of the mention. (Default: users)

    mentioned_user_ids[]

    array of strings

    Specifies an array of IDs of the users to mention in the message. This property is used only when mention_type is users.

    List of properties for updating an admin message

    Properties
    RequiredTypeDescription

    message_type

    string

    Specifies the type of the message. The value of ADMM represents an admin message.

    OptionalTypeDescription

    message

    string

    Specifies the content of the message.

    custom_type

    string

    Specifies a custom message type used for message grouping. The length is limited to 128 characters.

    * Custom types are also used within Sendbird's Advanced analytics to segment metrics, which enables the sub-classification of data views.

    data

    string

    Specifies additional message information such as custom font size, font type, or JSON formatted string.

    mention_type

    string

    Specifies whether to mention specific users or all users in the channel. Acceptable values are users and channels. If set to users, up to ten users in the mentioned_user_ids property below are notified of the mention. If set to channels, up to ten users in the channel are notified of the mention. (Default: users)

    mentioned_user_ids[]

    array of strings

    Specifies an array of IDs of the users to mention in the message. This property is used only when mention_type is users.

    {
        "message_type":"MESG",
        "mentioned_user_ids": ["joanna"]
    }
    

    Response

    If successful, this action returns an updated message resource in the response body.

    In the case of an error, an error object is returned. A detailed list of error codes is available here.