Files
webhook/wxinteract_test_samples.json
Andy Dixon 1d336e4cac Add Webex Interact webhook parser
- Added wxinteractParse() function supporting all SMS API events:
  * Outbound SMS (submitted, delivered, failed)
  * Shortlink clicked
  * Inbound SMS received
  * SMS opt out
  * Contacts callback
- Helper functions for each event type with formatted HTML
- Test samples file for all event types
- Updated README with Webex Interact documentation
- Follows existing parser style and security guidelines
2026-01-22 16:57:55 +00:00

87 lines
2.4 KiB
JSON

{
"outbound_sms_submitted": {
"data": {
"status": "submitted",
"message_id": "msg_123456789",
"to": "+61412345678",
"from": "+61387654321",
"message": "Hello! Your appointment is confirmed for tomorrow at 2 PM.",
"submitted_at": "2026-01-22T16:45:00Z",
"campaign_id": "camp_987654321"
}
},
"outbound_sms_delivered": {
"data": {
"status": "delivered",
"message_id": "msg_123456789",
"to": "+61412345678",
"from": "+61387654321",
"delivered_at": "2026-01-22T16:46:15Z",
"campaign_id": "camp_987654321"
}
},
"outbound_sms_failed": {
"data": {
"status": "failed",
"message_id": "msg_987654321",
"to": "+61499999999",
"from": "+61387654321",
"failed_at": "2026-01-22T16:47:00Z",
"error_code": "ERR_INVALID_NUMBER",
"error_message": "The destination number is invalid or not reachable",
"campaign_id": "camp_987654321"
}
},
"shortlink_clicked": {
"data": {
"status": "shortlink_clicked",
"shortlink": "https://wxint.co/abc123",
"original_url": "https://example.com/special-offer",
"clicked_at": "2026-01-22T17:30:45Z",
"phone_number": "+61412345678",
"message_id": "msg_123456789",
"campaign_id": "camp_987654321",
"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15",
"ip_address": "203.0.113.45"
}
},
"inbound_sms_received": {
"data": {
"status": "received",
"message_id": "msg_inbound_001",
"from": "+61412345678",
"to": "+61387654321",
"message": "YES I would like to receive updates",
"received_at": "2026-01-22T18:00:00Z",
"keyword": "YES"
}
},
"sms_opt_out": {
"data": {
"status": "opt_out",
"phone_number": "+61412345678",
"opt_out_at": "2026-01-22T18:15:00Z",
"keyword": "STOP",
"message_id": "msg_optout_001",
"from": "+61387654321"
}
},
"contact_created": {
"data": {
"status": "contact_created",
"contact_id": "contact_abc123",
"phone_number": "+61412345678",
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@example.com",
"created_at": "2026-01-22T19:00:00Z",
"updated_at": "2026-01-22T19:00:00Z",
"custom_fields": {
"company": "Acme Corporation",
"department": "Sales",
"customer_id": "CUST_12345"
}
}
}
}