SafeXTM Bot API

Create bots for SafeXTM, authenticate requests with a Bot Token, send text and media, and receive new updates through long polling or Webhooks. Private deployment is a separate enterprise option for organizations that need their own server environment.

Send your first message

Open BotFather in SafeXTM and send /newbot. Follow the prompts to choose a bot name and username, then keep the returned Bot Token private. The examples below use the request format documented in the developer docs.

curl -X POST "https://api.safew.bot/bot{YOUR_TOKEN}/sendmessage" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": 123456789,
    "text": "Hello, World!"
  }'
Success response
{
  "ok": true,
  "result": {
    "message_id": 1,
    "chat": {
      "id": 123456789,
      "type": "private"
    },
    "text": "Hello, World!"
  }
}

Use getUpdates for long polling when you want to retrieve new updates from the Bot API. For server-side integrations, the API also supports Webhooks that push updates to a URL you configure.

curl "https://api.safew.bot/bot{YOUR_TOKEN}/getupdates"

What you can do with the Bot API

SafeXTM bots communicate with the API over HTTPS. Use the Bot Token to authenticate requests, then choose the method that matches the message or update workflow you need.

Send text messages

Use sendMessage with a chat_id and text to send messages from your bot to a supported conversation.

Send photos and video

Use media methods such as sendPhoto and sendVideo when your integration needs more than plain text.

Send files and audio

The Bot API also includes methods for voice messages, audio, documents, and media groups.

Receive updates

Use getUpdates to retrieve new updates through long polling when a simple polling workflow is enough.

Use Webhooks

Configure a Webhook when you want SafeXTM updates delivered to your server instead of repeatedly polling for new events.

Bot Token authentication

Each bot receives a unique Token from BotFather. Keep it out of public code, logs, screenshots, and shared repositories.

Common integration scenarios

Notifications

Send automated status updates, alerts, workflow messages, or other notifications into SafeXTM conversations.

Bot interactions

Build bots that receive user updates and respond with text, media, documents, or other supported message types.

Business integrations

Connect internal tools or services to SafeXTM messaging workflows without confusing Bot API access with private deployment.

How to get started

  1. 1
    Create a bot

    Open BotFather in SafeXTM, send /newbot, and follow the prompts to choose a name and username.

  2. 2
    Save the Bot Token

    BotFather returns the Token used to authenticate API requests. Store it securely and never commit it to a public repository.

  3. 3
    Call an API method

    Start with sendMessage, then use getUpdates, a Webhook, or supported media methods as your integration grows.

SafeXTM API FAQ

How do I create a SafeXTM bot?

Open BotFather in SafeXTM and send /newbot. Follow the prompts to set the bot name and username. When the bot is created, BotFather returns the Bot Token used for API authentication.

What is the SafeXTM Bot API URL format?

Bot API requests use the format https://api.safew.bot/bot{token}/{method}. Replace {token} with your Bot Token and {method} with the API method you want to call.

How do I receive new bot updates?

You can use getUpdates for long polling or configure a Webhook so new updates are pushed to your server. These are alternative update-delivery approaches for different integration architectures.

Can the SafeXTM Bot API send media?

Yes. The current Bot API documentation includes methods for photos, videos, voice messages, audio, documents, and media groups in addition to ordinary text messages.

Can I publish my Bot Token in source code?

No. The Token identifies and authenticates the bot. Keep it in a secure configuration or secret store. If it is exposed, regenerate it through BotFather and replace the compromised Token.

Is the Bot API the same as private deployment?

No. The Bot API is designed for bots, messaging automation, and application integrations. Private deployment is a separate enterprise option for organizations that want SafeXTM deployed in their own server environment.

Need help with an integration or private deployment?

Contact SafeXTM support

[email protected]