Bot

Send a bot's message

Changed on

Send a bot message

Sends a bot message to a group channel.

https://sendbird.com/docs/chat/platform-api/v3/bot/sending-a-bot-message/send-a-bot-message#1-send-a-bot-message

bot_userid
Type: string
Description: Specifies the ID of the bot to send a message.

post/v3/bots/{bot_userid}/send

Request

  • Base URL
    https://api-APP_ID.sendbird.com
  • Auth
    none declared

Path parameters

bot_useridstring required

(Required)

Headers

api-tokenstring
Example:{{API_TOKEN}}

Request body multipart/form-data

message_type'MESG' | 'FILE' required

Specifies the type of message to send. MESG for text message, FILE for file message.

channel_urlstring required

Specifies the URL of the channel to send the message to.

messagestring

Specifies the content of the message. * This property is required when message_type is MESG.

mentionedstring[]
  • This property is available when message_type is MESG.
filestring binary

When sending a single file with a message, specifies the data of the file to upload to the Sendbird server in raw binary format. When sending a request containing a file, change the value of the content-type header to multipart/form-data;boundary={your_unique_boundary_string} in the request. * This property is required when message_type is FILE. * This doesn't allow a converted base64-encoded string from a file as its value.

require_authboolean

Determines whether to require an authentication key to verify if the file is being properly accessed. Only the user who uploaded the file or users who are in the channel where the file was uploaded should have access. The authentication key managed internally by the Sendbird system is generated every time a user logs in to the Sendbird server and is valid for three days starting from the last login. If set to false, Sendbird tries to access a file without any key. To access encrypted files, such as the files in the Sendbird server which are by default encrypted, the property must be set to true. (Default: false) The require_auth parameter only works if the file or URL is managed by Sendbird, which means that when you upload files using multipart format or provide URLs that point to the files hosted on the Sendbird server. However, if the file is hosted on a server or service that is not managed by Sendbird, access control and authentication for the file should be handled by the respective server or service hosting the file. * This property is available when message_type is FILE.

mention_type'users' | 'channel'
  • This property is available when message_type is FILE.
mentioned_user_idsstring[]
  • This property is available when message_type is FILE.
is_silentboolean
  • This property is available when message_type is FILE.
apns_bundle_idstring
  • This property is available when message_type is FILE.
apple_critical_alert_optionsobject
  • This property is available when message_type is FILE.
soundstring
  • This property is available when message_type is FILE.
volumenumber
  • This property is available when message_type is FILE.
created_atinteger
custom_typestring
datastring
dedup_idstring
mark_as_readboolean
send_pushboolean

Example request

{
  "sorted_metaarray": [
    {
      "value": [
        "value",
        "value"
      ],
      "key": "key"
    }
  ]
}

Response

Successful response

Example response

{
  "message": {
    "data": "data",
    "message_events": {
      "update_last_message": true,
      "update_mention_count": true,
      "send_push_notification": "send_push_notification",
      "update_unread_count": true
    },
    "custom_type": "custom_type",
    "is_reply_to_channel": true,
    "created_at": 7,
    "is_removed": true,
    "type": "type",
    "req_id": "req_id",
    "file": "{}",
    "updated_at": 3,
    "translations": "{}",
    "thread_info": "{}",
    "mentioned_users": [
      {
        "metadata": "{}",
        "require_auth_for_profile_image": true,
        "is_active": true,
        "role": "",
        "user_id": "user_id",
        "profile_url": "profile_url",
        "nickname": "nickname",
        "is_blocked_by_me": true
      },
      {
        "metadata": "{}",
        "require_auth_for_profile_image": true,
        "is_active": true,
        "role": "",
        "user_id": "user_id",
        "profile_url": "profile_url",
        "nickname": "nickname",
        "is_blocked_by_me": true
      }
    ],
    "channel_type": "channel_type",
    "message_survival_seconds": 9,
    "silent": true,
    "parent_message_id": 4,
    "parent_message_info": {
      "file": {
        "file_name": "file_name",
        "file_type": "file_type",
        "require_auth": true,
        "thumbnails": [
          {
            "real_width": 1,
            "width": 1,
            "plain_url": "plain_url",
            "real_height": 1,
            "url": "url",
            "height": 7
          },
          {
            "real_width": 1,
            "width": 1,
            "plain_url": "plain_url",
            "real_height": 1,
            "url": "url",
            "height": 7
          }
        ],
        "url": "url",
        "file_size": 4
      },
      "custom_type": "custom_type",
      "files": [
        {
          "file_name": "file_name",
          "file_type": "file_type",
          "require_auth": true,
          "thumbnails": [
            {
              "real_width": 1,
              "width": 1,
              "plain_url": "plain_url",
              "real_height": 1,
              "url": "url",
              "height": 7
            },
            {
              "real_width": 1,
              "width": 1,
              "plain_url": "plain_url",
              "real_height": 1,
              "url": "url",
              "height": 7
            }
          ],
          "url": "url",
          "file_size": 4
        },
        {
          "file_name": "file_name",
          "file_type": "file_type",
          "require_auth": true,
          "thumbnails": [
            {
              "real_width": 1,
              "width": 1,
              "plain_url": "plain_url",
              "real_height": 1,
              "url": "url",
              "height": 7
            },
            {
              "real_width": 1,
              "width": 1,
              "plain_url": "plain_url",
              "real_height": 1,
              "url": "url",
              "height": 7
            }
          ],
          "url": "url",
          "file_size": 4
        }
      ],
      "message": "message",
      "type": "type",
      "user": {
        "metadata": "{}",
        "is_active": true,
        "preferred_languages": [
          "preferred_languages",
          "preferred_languages"
        ],
        "require_auth_for_profile_image": true,
        "unread_channel_count": 6,
        "discovery_keys": [
          "discovery_keys",
          "discovery_keys"
        ],
        "profile_url": "profile_url",
        "is_created": true,
        "created_at": 9,
        "has_ever_logged_in": true,
        "locale": "locale",
        "unread_message_count": 8,
        "access_token": "access_token",
        "is_shadow_blocked": true,
        "user_id": "user_id",
        "nickname": "nickname",
        "phone_number": "phone_number",
        "is_online": true,
        "state": "",
        "is_hide_me_from_friends": true,
        "last_seen_at": 9
      },
      "ts": 5
    },
    "require_auth": true,
    "message_id": 1,
    "sorted_metaarray": [
      {
        "value": [
          "value",
          "value"
        ],
        "key": "key"
      },
      {
        "value": [
          "value",
          "value"
        ],
        "key": "key"
      }
    ],
    "mention_type": "mention_type",
    "message": "message",
    "channel_url": "channel_url",
    "is_op_msg": true,
    "message_retention_hour": 6,
    "extended_message_payload": null,
    "files": [
      {
        "file_name": "file_name",
        "file_type": "file_type",
        "require_auth": true,
        "thumbnails": [
          {
            "real_width": 1,
            "width": 1,
            "plain_url": "plain_url",
            "real_height": 1,
            "url": "url",
            "height": 7
          },
          {
            "real_width": 1,
            "width": 1,
            "plain_url": "plain_url",
            "real_height": 1,
            "url": "url",
            "height": 7
          }
        ],
        "url": "url",
        "file_size": 4
      },
      {
        "file_name": "file_name",
        "file_type": "file_type",
        "require_auth": true,
        "thumbnails": [
          {
            "real_width": 1,
            "width": 1,
            "plain_url": "plain_url",
            "real_height": 1,
            "url": "url",
            "height": 7
          },
          {
            "real_width": 1,
            "width": 1,
            "plain_url": "plain_url",
            "real_height": 1,
            "url": "url",
            "height": 7
          }
        ],
        "url": "url",
        "file_size": 4
      }
    ],
    "reactions": [
      {
        "updated_at": 2,
        "user_ids": [
          "user_ids",
          "user_ids"
        ],
        "key": "key"
      },
      {
        "updated_at": 2,
        "user_ids": [
          "user_ids",
          "user_ids"
        ],
        "key": "key"
      }
    ],
    "user": {
      "metadata": "{}",
      "require_auth_for_profile_image": true,
      "is_active": true,
      "role": "",
      "user_id": "user_id",
      "profile_url": "profile_url",
      "nickname": "nickname",
      "is_blocked_by_me": true
    }
  }
}

Changes

    • breaking

      added to the / response property oneOf list for the response status

    • info

      removed from the / response property oneOf list for the response status

    • breaking

      added to the / response property oneOf list for the response status

    • info

      removed from the / response property oneOf list for the response status