/ Platform API
Platform API
    Chat Platform API v3
    Chat Platform API
    Chat Platform API
    Version 3

    Add a reaction

    Copy link

    Adds a specific reaction to a message.

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


    HTTP request

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

    Parameters

    Copy link

    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

    Copy link

    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 30 characters.

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

    Response

    Copy link

    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

    Copy link
    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.