Skip to content

Introduction

SafeW API is a set of HTTP interfaces that allow developers to create and manage chatbots. With this API, you can:

  • Send and receive text, images, videos, audio, files and other message types
  • Receive message updates via long polling

API Modules

ModuleDescriptionAuthentication
Bot APICore bot interfaceBot Token

Basic Concepts

Bot Token

Each bot has a unique Token for API authentication. The Token is a string obtained when creating the bot.

Request Format

All API requests are sent via HTTP, supporting JSON and multipart/form-data formats. The Token is included in the URL path for authentication.

Response Format

All Bot API responses are in JSON format:

json
{
  "ok": true,
  "result": { }
}

Error response:

json
{
  "ok": false,
  "error_code": 400,
  "description": "Bad Request: chat not found"
}