Potato · A simple, safe and reliable global instant messaging experience.
Home page / Developer / Bot API
BOT API

Build services with Bot API

Receive updates, process commands, and bring your services into the Potato chat interface via the HTTPS interface.

Bot API is an HTTPS-based interface. First create a Bot and keep the token safely, and then your service calls the interface or receives updates to achieve automated replies and interaction capabilities.

1. Create your Bot

Create a Bot in Potato through the official robot management portal, and set the name, username and description. After creation, an access token will be obtained; the token is equivalent to a password and should not be embedded in web pages, clients, or public warehouses.

Preparation Checklist

  • A Potato account for managing bots
  • A backend that can be served over HTTPS
  • Secure environment for saving tokens and logs

2. Receive user messages

Your service can get updates regularly, or you can configure a webhook to push updates to a specified HTTPS address. After receiving the message, the business logic is executed based on the command, text or callback data, and then the message sending interface is called to reply to the user.

3. Design reliable interactions

Provide clear command descriptions and button copywriting for commonly used functions; provide timely processing feedback for time-consuming operations. When processing updates, you should log necessary request information, perform input validation, and avoid writing user private data to unprotected logs.

Security advice

Store the token in the server environment variable or key management system; if there is any suspicion of leakage, the token should be reset immediately at the management entrance. In the production environment, please use HTTPS, limit access to the management interface, and implement current limiting protection for frequent requests.

Return to Developer Center