技能 编程开发 播道(Podium)Webhook事件处理

播道(Podium)Webhook事件处理

v20260423
podium-webhooks-events
用于接收和处理来自Podium平台的实时Webhook事件。通过实现事件路由和幂等处理机制,可以捕获客户消息、新评论和支付完成等关键业务事件,实现系统自动化集成和业务流程的优化。
获取技能
197 次下载
概览

Podium Webhooks Events

Overview

Handle Podium webhook events for messages, reviews, and payments with event routing and idempotent processing.

Prerequisites

  • Podium OAuth tokens configured
  • HTTPS webhook endpoint

Instructions

Step 1: Webhook Event Types

EventDescription
message.receivedInbound customer message
message.sentOutbound message delivered
message.failedMessage delivery failed
review.createdNew review posted
payment.completedInvoice payment received

Step 2: Event Handler

import express from 'express';

const app = express();
app.post('/webhooks/podium', express.json(), async (req, res) => {
  const { type, data } = req.body;

  const handlers: Record<string, (data: any) => Promise<void>> = {
    'message.received': async (d) => {
      console.log(`Message from ${d.attributes['contact-phone']}: ${d.attributes.body}`);
    },
    'message.sent': async (d) => {
      console.log(`Message delivered: ${d.id}`);
    },
    'review.created': async (d) => {
      console.log(`New review: ${d.attributes.rating}/5`);
    },
    'payment.completed': async (d) => {
      console.log(`Payment received: $${d.attributes.amount / 100}`);
    },
  };

  const handler = handlers[type];
  if (handler) await handler(data);
  res.status(200).json({ received: true });
});

Step 3: Register Webhook

await podium.post('/webhooks', {
  data: {
    attributes: {
      url: 'https://your-app.com/webhooks/podium',
      events: ['message.received', 'message.sent', 'review.created', 'payment.completed'],
    },
  },
});

Output

  • Webhook endpoint handling all Podium event types
  • Event routing to specific handlers
  • Message, review, and payment events processed

Error Handling

IssueCauseSolution
No events receivedWrong URLVerify HTTPS URL in webhook config
Duplicate eventsRetry deliveryImplement idempotency with event IDs
Handler timeoutSlow processingOffload to background queue

Resources

Next Steps

For error diagnosis, see podium-common-errors.

信息
分类 编程开发
名称 podium-webhooks-events
版本 v20260423
大小 2.79KB
更新时间 2026-04-28
语言