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

    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 the mentioning method that indicates which user gets a notification of the message. Acceptable values are users and channels. If set to users, only the specified users with the mentioned_user_ids property below get notified. If set to channels, all users in the channel get notified. (Default: users)

    mentioned_user_ids[]

    array of strings

    Specifies an array of one or more IDs of the users who get a notification of the message.

    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 the mentioning method that indicates which user gets a notification of the message. Acceptable values are users and channels. If set to users, only the specified users with the mentioned_user_ids property below get notified. If set to channels, all users in the channel get notified. (Default: users)

    mentioned_user_ids[]

    array of strings

    Specifies an array of one or more IDs of the users who get a notification of the message.

    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 the mentioning method that indicates which user gets a notification of the message. Acceptable values are users and channels. If set to users, only the specified users with the mentioned_user_ids property below get notified. If set to channels, all users in the channel get notified. (Default: users)

    mentioned_user_ids[]

    array of strings

    Specifies an array of one or more IDs of the users who get a notification of the message.

    {
        "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.