· Nacho Coll · Guides · 8 min leestijd
X Alerts API: Programmatische Abonnementen en Meldingsgeschiedenis
Bouw aangepaste integraties bovenop WALLAWHATS. Voeg X-abonnementen toe en verwijder ze, routeer alerts naar kanalen, haal meldingsgeschiedenis op — alles via REST.

Wanneer real-time X (Twitter) alerts missiekritiek worden voor je bedrijf, stoot handmatig dashboardbeheer tegen een muur aan. Of je nu customer intelligence dashboards bouwt, brand monitoring workflows automatiseert, of aangepaste notification systems voor trading desks creëert, je hebt programmatische controle nodig over je X alert abonnementen.
WALLAWHATS biedt een REST API waarmee je X alert abonnementen kunt aanmaken, beheren en auditen zonder de webinterface aan te raken. Voeg gecontroleerde accounts toe of verwijder ze, haal meldingsgeschiedenis op met delivery status, en integreer real-time X alerts in elk systeem dat HTTP spreekt.

Waarom de WALLAWHATS API Gebruiken?
Het dashboard werkt geweldig voor handmatige workflows, maar API-toegang ontgrendelt automatiseringsscenario’s die verder schalen dan menselijk beheer:
Customer Intelligence Platforms: Abonneer je automatisch op nieuw geïdentificeerde concurrent executives, product leads, of industry analisten zodra ze ontdekt worden via research tools of CRM-integraties.
Trading en Financiële Workflows: Monitor programmatisch regulatory accounts, CEO handles, of sector-specifieke journalisten gebaseerd op portfolio wijzigingen of marktevenementen—zonder handmatig abonnementbeheer.
Brand Monitoring op Schaal: Voeg brand mention tracking toe of verwijder het als nieuwe campaigns lanceren, producten shippen, of crisissituaties zich ontwikkelen.
Multi-Tenant SaaS Applicaties: White-label real-time X monitoring voor je klanten, met programmatisch abonnementbeheer achter de schermen.
Compliance en Audit Systemen: Haal complete meldingsgeschiedenis op met delivery status voor regulatory reporting, interne audit trails, of SLA monitoring.
API Authenticatie en Toegang
Elk WALLAWHATS plan bevat API-toegang met schaalbare key quota’s:
- Free: 1 API key
- Pro: 1 API key
- Pro+: 2 API keys
- Business: 5 API keys
- Enterprise: 20 API keys
Authenticatie gebruikt de x-api-key header (niet Authorization: Bearer). Genereer je keys vanuit de API-sectie van het dashboard, en behandel ze als wachtwoorden—ze hebben volledige account privileges.
curl -H "x-api-key: your_api_key_here" \
https://api.wallawhats.com/subscriptionsCore API Endpoints
De WALLAWHATS API biedt vijf hoofdresourcegroepen voor het bouwen van integraties:
Subscription Management
Maak een nieuw abonnement aan:
POST /subscriptions
Content-Type: application/json
x-api-key: your_api_key_here
{
"xUsername": "elonmusk"
}Lijst alle abonnementen:
GET /subscriptions
x-api-key: your_api_key_hereVerwijder een abonnement:
DELETE /subscriptions/elonmusk
x-api-key: your_api_key_hereLet op dat het delete endpoint de X handle als path parameter neemt—niet een interne subscription ID.
Notification History en Audit
Haal meldingsgeschiedenis op met delivery status:
GET /notifications?from=1704067200000&to=1704153600000
x-api-key: your_api_key_hereHet notifications endpoint geeft gepagineerde resultaten terug waarbij elke rij één alert vertegenwoordigt die naar één kanaal is verzonden. Status waardes bevatten:
queued: Alert geaccepteerd, wacht op deliverysent: Verzonden naar de kanaal providerdelivered: Ontvangst bevestigd door de bestemmingread: Geopend door de ontvanger (alleen WhatsApp, vereist ingeschakelde leesbevestigingen)failed: Delivery poging mislukt
Channel Management
Lijst geconfigureerde kanalen:
GET /channels
x-api-key: your_api_key_hereVoeg een nieuw kanaal toe:
POST /channels
Content-Type: application/json
x-api-key: your_api_key_here
{
"type": "email",
"destination": "alerts@yourcompany.com"
}Verwijder een kanaal:
DELETE /channels/channel_id_here
x-api-key: your_api_key_hereTweet Snapshots
Toegang tot de snapshot gallery:
GET /snapshots
x-api-key: your_api_key_hereVerwijder een specifieke snapshot:
DELETE /snapshots/tweet_id_here
x-api-key: your_api_key_hereIntegraties Bouwen: Code Voorbeelden
Node.js Integratie
Hier is een Node.js voorbeeld dat een abonnement toevoegt en poll voor nieuwe meldingen:
const axios = require('axios');
class WallaWhatsClient {
constructor(apiKey) {
this.apiKey = apiKey;
this.baseURL = 'https://api.wallawhats.com';
}
async addSubscription(xUsername) {
try {
const response = await axios.post(
`${this.baseURL}/subscriptions`,
{ xUsername },
{ headers: { 'x-api-key': this.apiKey } }
);
return response.data;
} catch (error) {
throw new Error(`Failed to add subscription: ${error.response?.data?.message || error.message}`);
}
}
async getNotifications(from, to, lastKey = null) {
try {
let url = `${this.baseURL}/notifications?from=${from}&to=${to}`;
if (lastKey) url += `&lastKey=${lastKey}`;
const response = await axios.get(url, {
headers: { 'x-api-key': this.apiKey }
});
return response.data;
} catch (error) {
throw new Error(`Failed to fetch notifications: ${error.response?.data?.message || error.message}`);
}
}
async listSubscriptions() {
try {
const response = await axios.get(
`${this.baseURL}/subscriptions`,
{ headers: { 'x-api-key': this.apiKey } }
);
return response.data;
} catch (error) {
throw new Error(`Failed to list subscriptions: ${error.response?.data?.message || error.message}`);
}
}
}
// Usage example
async function monitorCompetitor() {
const client = new WallaWhatsClient('your_api_key_here');
// Add a new subscription
await client.addSubscription('vercel');
console.log('Now monitoring @vercel');
// Check recent notifications
const oneDayAgo = Date.now() - (24 * 60 * 60 * 1000);
const notifications = await client.getNotifications(oneDayAgo, Date.now());
console.log(`Found ${notifications.items.length} recent alerts`);
notifications.items.forEach(notification => {
console.log(`${notification.xUsername}: ${notification.status} at ${notification.timestamp}`);
});
}Python Integratie
Voor Python workflows, hier is een klasse die subscription management en notification polling afhandelt:
import requests
import time
from datetime import datetime, timedelta
class WallaWhatsAPI:
def __init__(self, api_key):
self.api_key = api_key
self.base_url = 'https://api.wallawhats.com'
self.headers = {'x-api-key': api_key}
def add_subscription(self, x_username):
"""Add a new X account to monitor"""
response = requests.post(
f'{self.base_url}/subscriptions',
json={'xUsername': x_username},
headers=self.headers
)
response.raise_for_status()
return response.json()
def remove_subscription(self, x_username):
"""Remove an X account from monitoring"""
response = requests.delete(
f'{self.base_url}/subscriptions/{x_username}',
headers=self.headers
)
response.raise_for_status()
return response.status_code == 200
def get_notifications(self, from_ms, to_ms, last_key=None):
"""Fetch notification history with pagination"""
params = {'from': from_ms, 'to': to_ms}
if last_key:
params['lastKey'] = last_key
response = requests.get(
f'{self.base_url}/notifications',
params=params,
headers=self.headers
)
response.raise_for_status()
return response.json()
def get_all_notifications(self, from_ms, to_ms):
"""Fetch all notifications in a time range, handling pagination"""
all_notifications = []
last_key = None
while True:
batch = self.get_notifications(from_ms, to_ms, last_key)
all_notifications.extend(batch['items'])
if not batch.get('lastKey'):
break
last_key = batch['lastKey']
return all_notifications
def list_subscriptions(self):
"""Get all current subscriptions"""
response = requests.get(
f'{self.base_url}/subscriptions',
headers=self.headers
)
response.raise_for_status()
return response.json()
# Example: Daily audit report
def generate_daily_report():
api = WallaWhatsAPI('your_api_key_here')
# Get yesterday's notifications
end_time = int(time.time() * 1000)
start_time = end_time - (24 * 60 * 60 * 1000)
notifications = api.get_all_notifications(start_time, end_time)
# Group by account and status
report = {}
for notification in notifications:
account = notification['xUsername']
status = notification['status']
if account not in report:
report[account] = {'total': 0, 'delivered': 0, 'failed': 0}
report[account]['total'] += 1
if status in ['delivered', 'read']:
report[account]['delivered'] += 1
elif status == 'failed':
report[account]['failed'] += 1
# Print summary
print(f"Daily Alert Report - {datetime.now().strftime('%Y-%m-%d')}")
print("-" * 50)
for account, stats in report.items():
success_rate = (stats['delivered'] / stats['total']) * 100 if stats['total'] > 0 else 0
print(f"@{account}: {stats['total']} alerts, {success_rate:.1f}% delivered")Channel Routing Begrijpen
WALLAWHATS gebruikt een globaal channel routing model—elke alert van elk abonnement verspreidt zich naar alle ingeschakelde en geverifieerde kanalen. Je kunt specifieke accounts niet routeren naar specifieke bestemmingen via de API (zoals “@elonmusk → WhatsApp, @vercel → email”).
Kanaalkeuze gebeurt op accountniveau op de Channels pagina. Wanneer je een kanaal toevoegt via API, wordt het beschikbaar voor alle alerts zodra het geverifieerd is. Wanneer je een kanaal verwijdert, stopt het met het ontvangen van alerts van alle abonnementen.
Dit ontwerp vereenvoudigt automatisering terwijl alert fragmentatie wordt voorkomen. Je integratiecode hoeft geen per-subscription routing regels bij te houden—beheer alleen welke accounts te monitoren en welke kanalen in te schakelen.
Rate Limits en Velocity Caps
WALLAWHATS implementeert user-level velocity caps om alert spam te voorkomen tijdens periodes van hoge activiteit:
- Free: 2 alerts/uur
- Pro: 5 alerts/uur
- Pro+: 15 alerts/uur
- Business: 30 alerts/uur
- Enterprise: 100 alerts/uur
Wanneer velocity caps overschreden worden, worden extra tweets gebufferd in digest berichten en elke 15 minuten verzonden. Je API-integratie zal deze zien als aparte notification records—één voor de onmiddellijke alert, en één voor elke digest batch.
De API zelf legt geen aparte rate limits op aan subscription management of notification queries. Vermijd echter het hameren op de endpoints met onnodige requests—cache subscription lijsten lokaal en batch notification queries efficiënt.
Error Handling en Troubleshooting
Veelvoorkomende API error patterns en hoe ze af te handelen:
Authenticatie failures (401):
- Verifieer dat je API key correct is en niet ingetrokken
- Zorg ervoor dat je de
x-api-keyheader gebruikt, nietAuthorization
Subscription conflicts (409):
- Account al gemonitord: Het abonnement bestaat, behandel als succes
- Account protected/private: WALLAWHATS weigert deze by design
Rate limiting (429):
- Back off exponentieel voordat je opnieuw probeert
- Controleer of je de plan limieten nadert voor gemonitorde accounts
Channel verification issues:
- Nieuwe kanalen vereisen OTP verificatie voordat ze alerts ontvangen
- Programmatisch toegevoegde kanalen werken niet tot de gebruiker verificatie voltooit
Je Integraties Monitoren en Alerting
Omdat WALLAWHATS kritieke infrastructuur wordt wanneer geïntegreerd in business workflows, monitor je integratie gezondheid:
Subscription Drift Detection:
// Check if expected subscriptions are still active
async function auditSubscriptions(expectedHandles) {
const current = await client.listSubscriptions();
const currentHandles = current.map(s => s.xUsername);
const missing = expectedHandles.filter(h => !currentHandles.includes(h));
if (missing.length > 0) {
console.warn(`Missing subscriptions: ${missing.join(', ')}`);
}
return missing;
}Delivery Success Rate Monitoring:
def check_delivery_health():
# Check last 6 hours
end_time = int(time.time() * 1000)
start_time = end_time - (6 * 60 * 60 * 1000)
notifications = api.get_all_notifications(start_time, end_time)
if not notifications:
return None
delivered = sum(1 for n in notifications if n['status'] in ['delivered', 'read'])
total = len(notifications)
success_rate = (delivered / total) * 100
if success_rate < 95:
# Alert your ops team
print(f"WARNING: Delivery success rate dropped to {success_rate:.1f}%")
return success_rateIntegratiepatronen en Best Practices
Webhook-Style Processing: Hoewel WALLAWHATS geen webhooks direct biedt, kun je het notifications endpoint pollen voor nieuwe alerts en ze in near-real-time verwerken:
async function pollForNewAlerts() {
const lastCheck = localStorage.getItem('lastNotificationCheck') || Date.now() - 300000;
const now = Date.now();
const notifications = await client.getNotifications(lastCheck, now);
for (const notification of notifications.items) {
if (notification.status === 'delivered') {
// Process the alert - send to Slack, update database, etc.
await processAlert(notification);
}
}
localStorage.setItem('lastNotificationCheck', now);
}
// Poll every 30 seconds
setInterval(pollForNewAlerts, 30000);Conditional Subscription Management: Voeg abonnementen dynamisch toe of verwijder ze gebaseerd op externe triggers:
def update_competitor_monitoring(portfolio_companies):
"""Update X monitoring based on current portfolio"""
current_subs = {s['xUsername'] for s in api.list_subscriptions()}
# Accounts we should be monitoring
target_accounts = set()
for company in portfolio_companies:
if company.get('ceo_twitter_handle'):
target_accounts.add(company['ceo_twitter_handle'])
if company.get('company_twitter_handle'):
target_accounts.add(company['company_twitter_handle'])
# Add missing subscriptions
for account in target_accounts - current_subs:
try:
api.add_subscription(account)
print(f"Started monitoring @{account}")
except Exception as e:
print(f"Failed to add @{account}: {e}")
# Remove outdated subscriptions
for account in current_subs - target_accounts:
api.remove_subscription(account)
print(f"Stopped monitoring @{account}")De WALLAWHATS API transformeert real-time X alerts van een handmatig dashboard tool naar een programmeerbare infrastructuurcomponent. Of je nu custom intelligence workflows bouwt, brand monitoring automatiseert, of white-label notification services creëert, de API biedt de controle en audit capabilities die nodig zijn voor productie-integratie.
Wil je je monitoring uitbreiden voorbij concurrenten? Bekijk onze guide over crypto Twitter monitoren voor marktsignalen of leer hoe journalisten WALLAWHATS gebruiken voor real-time bron monitoring.
Mis nooit meer een belangrijke post. Maak een gratis account aan — 1 WhatsApp nummer, real-time alerts, geen creditcard vereist.
