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

    Send a bot message

    Sends a bot message to a group channel.

    Note: Bots can only send text messages.


    HTTP request

    POST https://api-{application_id}.sendbird.com/v3/bots/{bot_userid}/send
    

    Parameters

    The following table lists the parameters that this action supports.

    Required
    Parameter nameTypeDescription

    bot_userid

    string

    Specifies the unique ID of a bot.


    Request body

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

    Properties
    RequiredTypeDescription

    message

    string

    Specifies the content of the message sent by the bot.

    channel_url

    string

    Specifies the URL of the channel that the message is sent to.

    OptionalTypeDescription

    custom_type

    string

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

    data

    string

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

    send_push

    boolean

    Determines whether to send a push notification for a message to the members of the channel. (Default: true)

    mentioned

    array of strings

    Specifies an array of IDs of users who receive a notification for the message.

    mark_as_read

    boolean

    Determines whether to mark the message as read for the bot. If set to false, the bot's unread_count and read_receipt remain unchanged after the message is sent. (Default: true)

    dedup_id

    string

    Specifies the unique ID of a message to prevent transferring duplicate message data to a channel.

    created_at

    long

    Specifies the time that the message was sent in Unix milliseconds format.

    {
        "message": "Hi John, here are some nearby restaurants that may interest you.",
        "channel_url": "sendbird_group_channel_24901438_c1bc35f5f0d237207bc1cba27351c878fc2f345b",
        "custom_type": "auto_answer_introduction"
    }
    

    Response

    If successful, this action returns a message resources in the response body.

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