Telegram Integration API

Connect and manage Telegram bot for sending notifications and alerts to users

Messaging Channel

Telegram Integration

Integrate Telegram bot for instant messaging to users. Send subscription alerts, security notifications, and support messages through Telegram.

Instant Messaging

Send messages directly via Telegram bot.

User Subscriptions

Users subscribe to receive notifications.

Secure Channel

End-to-end encrypted communication.


Bot Status

QUERY/graphql

Check the status of your Telegram bot connection and retrieve configuration details.

Authentication:Bearer Token
Required scopes:admin

GraphQL Query

query TelegramBotStatus {
  telegramBotStatus {
    connected
    botUsername
    botName
    subscriberCount
    webhookUrl
  }
}

HTTP Request:

curl -X POST https://api.orbnet.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -d '{
    "query": "query TelegramBotStatus { telegramBotStatus { connected botUsername botName subscriberCount webhookUrl } }"
  }'

Response

200Bot Connected
{
  "data": {
    "telegramBotStatus": {
      "connected": true,
      "botUsername": "@OrbVPNBot",
      "botName": "OrbVPN Notifications",
      "subscriberCount": 5420,
      "webhookUrl": "https://api.orbnet.com/telegram/webhook"
    }
  }
}
200Bot Not Configured
{
  "data": {
    "telegramBotStatus": {
      "connected": false,
      "botUsername": null,
      "botName": null,
      "subscriberCount": 0,
      "webhookUrl": null
    }
  }
}

Send Telegram Message

mutation sendTelegramMessage($chatId: String!, $message: String!) {
  sendTelegramMessage(chatId: $chatId, message: $message) {
    success
    messageId
  }
}

Variables:

{
  "chatId": "123456789",
  "message": "Your subscription has been renewed successfully!"
}

Setup Process

Create Bot

Configure Token

Set Webhook

Users Subscribe


Use Cases

Subscription Alerts

Notify users about expiring subscriptions.

Security Notifications

Alert users to login attempts and changes.

Payment Confirmations

Send instant payment receipts.

Support Updates

Notify about ticket responses.


Message Types

Text Messages

Simple text notifications with markdown support.

Rich Media

Send images, documents, and formatted content.

Inline Buttons

Interactive buttons for user actions.

Silent Messages

Send without notification sound.


Best Practices

Opt-in Required

Users must start the bot to receive messages.

Message Formatting

Use Markdown for better readability.

Rate Limits

Respect Telegram's messaging rate limits.

Error Handling

Handle blocked bots and deleted chats gracefully.



User Privacy

Telegram chat IDs are provided by users when they start your bot. Always respect user privacy and provide clear unsubscribe options.

Multi-Channel Notifications

Combine Telegram with other channels for comprehensive user communication.

Notification System