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

    Add a reaction

    Adds a specific reaction to a message.

    Note: Currently, this action is only available in group channels.


    HTTP request

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

    Parameters

    The following table lists the parameters that this action supports.

    Required
    Parameter nameTypeDescription

    channel_type

    string

    Specifies the type of the channel. Currently, only the value of group_channels is available.

    channel_url

    string

    Specifies the URL of the target channel.

    message_id

    long

    Specifies the unique ID of the message to add a reaction to.


    Request body

    The following table lists the properties of an HTTP request that this action supports.

    Required
    Property nameTypeDescription

    user_id

    string

    Specifies the ID of the user who reacts to the message.

    reaction

    string

    Specifies the unique key of the reaction to be added to the message. The length is limited to 192 characters.

    {
        "user_id": "Jessie",
        "reaction": "celebrate"
    }
    

    Response

    If successful, this action returns the information about the reaction event in the response body.

    {
        "user_id": "Jessie",
        "operation": "ADD",
        "success": true,
        "reaction": "celebrate",
        "msg_id": 711389299,
        "updated_at": 1577327594231
    }
    

    List of response properties

    Property nameTypeDescription

    user_id

    string

    The ID of the user who reacted to the message.

    operation

    string

    The operation type of the request. Valid values are ADD and DELETE.

    success

    boolean

    Indicates whether the reaction operation succeeded or failed. The value of false indicates that there is an identical reaction attempt made by the same user to the same message.

    reaction

    string

    The unique key of the reaction.

    updated_at

    long

    The time when the message reaction was updated in Unix milliseconds format. This appears only when the success property is true.

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