Telegram Bot Notifications
Overview
Section titled “Overview”Get real-time campaign alerts in Telegram using the GhostFlow API.
- Create a Telegram bot via @BotFather
- Get your chat ID via @userinfobot
- Deploy this script (Node.js):
import { Telegraf } from 'telegraf';
const bot = new Telegraf(process.env.TELEGRAM_BOT_TOKEN!);const GF_API_KEY = process.env.GF_API_KEY!;const CHAT_ID = process.env.TELEGRAM_CHAT_ID!;
async function checkStats() { const res = await fetch('https://devcore.getghostflow.io/api/v1/reports/dashboard', { headers: { 'Authorization': `Bearer ${GF_API_KEY}` }, }); const data = await res.json();
const message = `📊 Daily Summary\n` + `Clicks: ${data.clicks}\n` + `Conversions: ${data.conversions}\n` + `Revenue: $${data.revenue}\n` + `ROI: ${data.roi}%`;
await bot.telegram.sendMessage(CHAT_ID, message);}
// Run every hoursetInterval(checkStats, 3600000);bot.launch();Required Scopes
Section titled “Required Scopes”Your API key needs: read:stats