Webhooks
Real-time event notifications and automated workflow triggers through SOLVEFORCE webhook integration, enabling instant response to service events, billing changes, and system alerts.
π― Webhook Overview
SOLVEFORCE webhooks provide real-time HTTP-based event notifications that enable your applications and systems to respond instantly to service changes, billing events, support activities, and system alerts without continuous polling.
π Webhook Key Features
Real-Time Event Delivery:
- Instant HTTP POST notifications to your endpoints
- Guaranteed delivery with automatic retry mechanisms
- Event deduplication and ordering guarantees
- Payload signing for security and authenticity verification
- Configurable timeout and retry policies
Comprehensive Event Coverage:
- Service status changes and health monitoring events
- Billing and payment processing notifications
- Support ticket creation, updates, and resolution
- User account changes and access modifications
- Security alerts and compliance notifications
Enterprise-Grade Reliability:
- 99.9% delivery SLA with automatic failover
- Exponential backoff retry strategy
- Dead letter queue for failed deliveries
- Monitoring and alerting for webhook health
- Detailed delivery logs and analytics
π Event Types and Payloads
π Service Events
Service Status Changes:
{
"event_type": "service.status.changed",
"event_id": "evt_1234567890",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"service_id": "svc_voice_001",
"service_name": "Primary Voice Service",
"previous_status": "healthy",
"current_status": "degraded",
"location": "Chicago Data Center",
"impact": "medium",
"affected_users": 150,
"estimated_resolution": "2024-01-15T11:00:00Z"
},
"account": {
"id": "acc_123456",
"name": "Acme Corporation"
}
}
Service Provisioning Events:
{
"event_type": "service.provisioned",
"event_id": "evt_1234567891",
"timestamp": "2024-01-15T14:45:00Z",
"data": {
"service_id": "svc_data_002",
"service_type": "fiber_internet",
"bandwidth": "1000mbps",
"location": {
"address": "123 Main St, Chicago, IL 60601",
"site_id": "site_001"
},
"activation_date": "2024-01-15T14:45:00Z",
"billing_start_date": "2024-01-16T00:00:00Z"
}
}
Maintenance Notifications:
{
"event_type": "service.maintenance.scheduled",
"event_id": "evt_1234567892",
"timestamp": "2024-01-10T09:00:00Z",
"data": {
"maintenance_id": "mnt_001",
"title": "Network Equipment Upgrade",
"description": "Upgrading core router firmware",
"affected_services": ["svc_data_001", "svc_voice_001"],
"start_time": "2024-01-20T02:00:00Z",
"end_time": "2024-01-20T06:00:00Z",
"impact": "Service interruption expected",
"advance_notice_days": 10
}
}
π° Billing Events
Invoice Generation:
{
"event_type": "billing.invoice.generated",
"event_id": "evt_1234567893",
"timestamp": "2024-01-01T00:00:00Z",
"data": {
"invoice_id": "inv_202401001",
"invoice_number": "SF-2024-001",
"amount": 2500.00,
"currency": "USD",
"due_date": "2024-01-31T23:59:59Z",
"billing_period": {
"start": "2024-01-01T00:00:00Z",
"end": "2024-01-31T23:59:59Z"
},
"line_items": [
{
"service_id": "svc_voice_001",
"description": "Voice Services - 100 Users",
"amount": 1500.00
}
]
}
}
Payment Processing:
{
"event_type": "billing.payment.processed",
"event_id": "evt_1234567894",
"timestamp": "2024-01-15T16:30:00Z",
"data": {
"payment_id": "pay_987654321",
"invoice_id": "inv_202401001",
"amount": 2500.00,
"currency": "USD",
"payment_method": "credit_card",
"status": "succeeded",
"transaction_id": "txn_abc123def456"
}
}
Usage Alerts:
{
"event_type": "billing.usage.threshold_exceeded",
"event_id": "evt_1234567895",
"timestamp": "2024-01-15T18:00:00Z",
"data": {
"service_id": "svc_data_001",
"metric": "bandwidth_usage",
"threshold": 80,
"current_usage": 85,
"threshold_type": "percentage",
"billing_period": "current_month",
"projected_overage": 150.00
}
}
π« Support Events
Ticket Creation:
{
"event_type": "support.ticket.created",
"event_id": "evt_1234567896",
"timestamp": "2024-01-15T11:15:00Z",
"data": {
"ticket_id": "tkt_456789",
"title": "Voice Quality Issues",
"description": "Customers reporting poor call quality",
"priority": "high",
"category": "voice_services",
"status": "open",
"assigned_to": "John Smith",
"customer_contact": {
"name": "Jane Doe",
"email": "jane.doe@acme.com",
"phone": "+1-555-0123"
}
}
}
Ticket Resolution:
{
"event_type": "support.ticket.resolved",
"event_id": "evt_1234567897",
"timestamp": "2024-01-15T15:45:00Z",
"data": {
"ticket_id": "tkt_456789",
"resolution": "Replaced faulty network equipment",
"resolution_time_minutes": 270,
"customer_satisfaction": 5,
"resolved_by": "John Smith"
}
}
π Security Events
Security Alerts:
{
"event_type": "security.alert.created",
"event_id": "evt_1234567898",
"timestamp": "2024-01-15T20:30:00Z",
"data": {
"alert_id": "sec_alert_001",
"severity": "critical",
"type": "unauthorized_access_attempt",
"source_ip": "192.168.1.100",
"target_service": "voice_admin_portal",
"description": "Multiple failed login attempts detected",
"mitigation_actions": ["ip_blocked", "account_locked"]
}
}
βοΈ Webhook Configuration
π§ Setup and Registration
Webhook Registration Process:
- API Authentication: Obtain API credentials and access tokens
- Endpoint Configuration: Configure your webhook endpoint URL
- Event Subscription: Select specific event types to receive
- Security Setup: Configure webhook signing and verification
- Testing: Validate webhook delivery and payload processing
Registration API Example:
# Webhook Registration
import requests
webhook_config = {
"url": "https://your-app.com/webhooks/solveforce",
"events": [
"service.status.changed",
"billing.invoice.generated",
"support.ticket.created"
],
"secret": "your-webhook-secret",
"active": True,
"description": "Production webhook for service monitoring"
}
response = requests.post(
"https://api.solveforce.com/v1/webhooks",
headers={
"Authorization": "Bearer your-api-token",
"Content-Type": "application/json"
},
json=webhook_config
)
webhook_id = response.json()["webhook_id"]
π Security and Authentication
Webhook Signature Verification:
import hmac
import hashlib
def verify_webhook_signature(payload, signature, secret):
"""Verify webhook payload signature"""
expected_signature = hmac.new(
secret.encode('utf-8'),
payload.encode('utf-8'),
hashlib.sha256
).hexdigest()
return hmac.compare_digest(f"sha256={expected_signature}", signature)
# Example webhook handler
def handle_webhook(request):
payload = request.body
signature = request.headers.get('X-SolveForce-Signature')
secret = os.environ['WEBHOOK_SECRET']
if not verify_webhook_signature(payload, signature, secret):
return HttpResponse(status=401)
event_data = json.loads(payload)
process_event(event_data)
return HttpResponse(status=200)
Security Best Practices:
- HTTPS Only: Always use HTTPS for webhook endpoints
- Signature Verification: Validate all webhook payloads with signatures
- IP Whitelisting: Restrict webhook sources to SOLVEFORCE IP ranges
- Rate Limiting: Implement rate limiting for webhook endpoints
- Logging: Log all webhook events for audit and troubleshooting
π‘ Endpoint Requirements
Technical Requirements:
- HTTPS Protocol: SSL/TLS encryption required
- Response Time: Respond within 30 seconds
- Status Codes: Return appropriate HTTP status codes
- Idempotency: Handle duplicate events gracefully
- Content Type: Accept application/json payloads
Recommended Response Codes:
# Webhook Response Handling
def webhook_response_codes():
return {
200: "Success - Event processed successfully",
201: "Created - Event created new resource",
204: "No Content - Event acknowledged, no action needed",
400: "Bad Request - Invalid payload format",
401: "Unauthorized - Invalid signature",
403: "Forbidden - Access denied",
404: "Not Found - Endpoint not available",
429: "Too Many Requests - Rate limit exceeded",
500: "Internal Error - Temporary processing error",
503: "Service Unavailable - Temporarily unable to process"
}
π Event Processing and Workflows
π Event Handling Patterns
Immediate Response Pattern:
# Immediate processing for time-sensitive events
async def handle_service_outage(event_data):
if event_data["data"]["current_status"] == "outage":
# Immediate actions
await send_emergency_alert(event_data)
await activate_backup_services(event_data["data"]["service_id"])
await notify_incident_team(event_data)
return {"status": "processed", "actions": ["alert_sent", "backup_activated"]}
Queued Processing Pattern:
# Queue non-urgent events for batch processing
from celery import Celery
app = Celery('webhook_processor')
@app.task
def process_billing_event(event_data):
"""Process billing events asynchronously"""
if event_data["event_type"] == "billing.invoice.generated":
update_accounting_system(event_data)
send_customer_notification(event_data)
update_customer_portal(event_data)
Workflow Orchestration:
# Complex workflow triggered by webhook events
def orchestrate_service_provisioning(event_data):
if event_data["event_type"] == "service.provisioned":
workflow = [
update_inventory_system,
configure_monitoring,
send_welcome_email,
schedule_follow_up,
update_billing_system
]
for step in workflow:
try:
step(event_data)
except Exception as e:
handle_workflow_error(step, event_data, e)
break
π Event Analytics and Monitoring
Event Processing Metrics:
# Event processing analytics
class WebhookAnalytics:
def track_event_processing(self, event_type, processing_time, status):
metrics = {
"event_type": event_type,
"processing_time_ms": processing_time,
"status": status,
"timestamp": datetime.utcnow()
}
# Send to analytics platform
self.analytics_client.track("webhook_processed", metrics)
def get_processing_stats(self, time_range="24h"):
return {
"total_events": self.count_events(time_range),
"success_rate": self.calculate_success_rate(time_range),
"avg_processing_time": self.avg_processing_time(time_range),
"error_rate": self.calculate_error_rate(time_range)
}
π οΈ Implementation Examples
π’ Enterprise Integration Examples
Slack Notification Integration:
import slack_sdk
def send_slack_notification(webhook_event):
"""Send service alerts to Slack channels"""
client = slack_sdk.WebClient(token=os.environ['SLACK_BOT_TOKEN'])
if webhook_event["event_type"] == "service.status.changed":
data = webhook_event["data"]
if data["current_status"] in ["degraded", "outage"]:
message = f"""
π¨ *Service Alert*
*Service:* {data['service_name']}
*Status:* {data['current_status'].title()}
*Impact:* {data['impact'].title()}
*Affected Users:* {data['affected_users']}
*ETA:* {data.get('estimated_resolution', 'Unknown')}
"""
client.chat_postMessage(
channel="#service-alerts",
text=message,
username="SOLVEFORCE Monitor"
)
ServiceNow Integration:
def create_servicenow_incident(webhook_event):
"""Create ServiceNow incident from service outage"""
if (webhook_event["event_type"] == "service.status.changed" and
webhook_event["data"]["current_status"] == "outage"):
incident_data = {
"short_description": f"SOLVEFORCE Service Outage: {webhook_event['data']['service_name']}",
"description": f"Service outage detected for {webhook_event['data']['service_name']}",
"priority": "1" if webhook_event["data"]["impact"] == "high" else "2",
"category": "Network",
"subcategory": "Telecommunications",
"caller_id": "solveforce_integration",
"assignment_group": "Network Operations"
}
# Create incident via ServiceNow API
response = requests.post(
f"{servicenow_instance}/api/now/table/incident",
auth=(servicenow_user, servicenow_pass),
headers={"Content-Type": "application/json"},
json=incident_data
)
CRM Integration Example:
def update_salesforce_account(webhook_event):
"""Update Salesforce account with service information"""
if webhook_event["event_type"] == "service.provisioned":
sf_client = SalesforceAPI(
username=os.environ['SF_USERNAME'],
password=os.environ['SF_PASSWORD'],
security_token=os.environ['SF_TOKEN']
)
account_update = {
"Latest_Service_Addition__c": webhook_event["data"]["service_type"],
"Last_Service_Date__c": webhook_event["timestamp"],
"Service_Status__c": "Active"
}
sf_client.Account.update(
webhook_event["account"]["salesforce_id"],
account_update
)
π Automation Workflows
Multi-Step Automation:
class ServiceProvisioningWorkflow:
def __init__(self):
self.steps = [
self.validate_service_data,
self.update_inventory,
self.configure_monitoring,
self.notify_stakeholders,
self.schedule_follow_up
]
def process_webhook(self, event_data):
if event_data["event_type"] == "service.provisioned":
for step in self.steps:
try:
result = step(event_data)
self.log_step_completion(step.__name__, result)
except Exception as e:
self.handle_step_failure(step.__name__, e, event_data)
break
def validate_service_data(self, event_data):
# Validate service provisioning data
required_fields = ["service_id", "service_type", "location"]
for field in required_fields:
if field not in event_data["data"]:
raise ValueError(f"Missing required field: {field}")
return {"status": "validated"}
def update_inventory(self, event_data):
# Update inventory management system
inventory_api.add_service(
service_id=event_data["data"]["service_id"],
service_type=event_data["data"]["service_type"],
location=event_data["data"]["location"]
)
return {"status": "inventory_updated"}
π Monitoring and Troubleshooting
π Webhook Health Monitoring
Health Check Endpoint:
@app.route('/webhook/health', methods=['GET'])
def webhook_health():
"""Health check endpoint for webhook monitoring"""
health_status = {
"status": "healthy",
"timestamp": datetime.utcnow().isoformat(),
"checks": {
"database": check_database_connection(),
"external_apis": check_external_apis(),
"processing_queue": check_queue_health()
}
}
overall_status = all(health_status["checks"].values())
health_status["status"] = "healthy" if overall_status else "unhealthy"
return jsonify(health_status), 200 if overall_status else 503
Performance Monitoring:
class WebhookMonitoring:
def __init__(self):
self.metrics_client = MetricsClient()
def track_processing_time(self, event_type, start_time):
processing_time = (datetime.utcnow() - start_time).total_seconds() * 1000
self.metrics_client.histogram(
"webhook.processing_time",
processing_time,
tags={"event_type": event_type}
)
def track_error_rate(self, event_type, error_type):
self.metrics_client.increment(
"webhook.errors",
tags={"event_type": event_type, "error_type": error_type}
)
π Troubleshooting Common Issues
Failed Delivery Debugging:
def debug_webhook_delivery():
"""Debug webhook delivery issues"""
common_issues = {
"timeout": "Check endpoint response time (must be < 30s)",
"ssl_error": "Verify HTTPS certificate is valid",
"404_error": "Check webhook endpoint URL is correct",
"signature_mismatch": "Verify webhook secret and signature calculation",
"rate_limit": "Implement exponential backoff for retries"
}
return common_issues
def validate_webhook_endpoint(url, secret):
"""Validate webhook endpoint configuration"""
test_payload = {
"event_type": "webhook.test",
"event_id": "test_123",
"timestamp": datetime.utcnow().isoformat(),
"data": {"test": True}
}
signature = generate_signature(json.dumps(test_payload), secret)
try:
response = requests.post(
url,
json=test_payload,
headers={
"X-SolveForce-Signature": signature,
"Content-Type": "application/json"
},
timeout=30
)
return {
"status": "success" if response.status_code == 200 else "failed",
"response_code": response.status_code,
"response_time": response.elapsed.total_seconds()
}
except Exception as e:
return {"status": "error", "error": str(e)}
π Resources and Support
π οΈ Development Tools
Webhook Testing Tools:
- ngrok: Local development tunnel for webhook testing
- Webhook.site: Online webhook testing and inspection
- Postman: API testing and webhook simulation
- cURL: Command-line webhook testing
- SOLVEFORCE Webhook Tester: Built-in webhook testing dashboard
Code Examples Repository:
# Clone webhook examples repository
git clone https://github.com/solveforce/webhook-examples.git
# Available examples:
# - Python Flask webhook handler
# - Node.js Express webhook server
# - PHP webhook processor
# - Java Spring Boot webhook service
# - C# ASP.NET webhook controller
π Support Resources
Technical Support:
- Developer Documentation: webhooks.solveforce.com
- API Support: webhook-support@solveforce.com
- Community Forum: community.solveforce.com/webhooks
- Live Chat: Available 24/7 for webhook technical issues
- Phone Support: 1-888-WEBHOOK-HELP
Professional Services:
- Custom Webhook Development: End-to-end webhook implementation
- Integration Consulting: Architecture and best practice guidance
- Performance Optimization: Webhook performance tuning and optimization
- Security Assessment: Webhook security review and hardening
- Training Programs: Webhook development and integration training
Contact Information:
- Webhook Support: webhook-support@solveforce.com
- Technical Documentation: docs@solveforce.com
- Integration Services: integrations@solveforce.com
- Developer Relations: developers@solveforce.com
Your Real-Time Integration Partner β SOLVEFORCE Webhooks.
Comprehensive webhook platform designed to provide instant event notifications, automated workflow triggers, and seamless real-time integration capabilities for all your telecommunications and IT service management needs.