Skip to main content
If you need to send direct messages through an enterprise bot, refer to the steps in this document.

Define your requirements

Before you start development, review the following overview. This document helps you, in Stream mode, send a message to the bot during a direct chat. The bot then replies to your message by calling the Send one-on-one chat messages between users and bots in batches API. Try running the sample demo provided in “Quick start” to get a hands-on experience with the enterprise bot.

Prerequisites

  1. Complete the Configure the enterprise bot process (select Stream mode for the message receiving mode).
  2. Complete the API permission application for the OpenAPI endpoint. Request the Permission to send messages from an internal bot scope.
  3. Prepare the development environment:

Quick start

  1. Download the sample demo:
  2. Start the sample demo:

Procedure

The following is a Java example. For the Python example, download the demo from the section above.
  1. Add the dependencies to the project’s pom.xml file.
  2. Create the main method and start it.
  3. Send a message to the bot in a direct chat. You can then see the message sent by the bot.