teamup/webhook-php
Composer 安装命令:
composer require teamup/webhook-php
包简介
Client for receiving and processing Teamup webhook events
README 文档
README
This library provides some auxiliary code to receive, validate and process the data sent by Teamup in a webhook call. You can also check our API Docs for more details related to the API and Webhook itself.
Requirements
To create a webhook in your Teamup calendar, start by visiting the calendar page:
Settings > Integrations > Webhooks which lists all available webhooks
in the current calendar.
Use the + New button to create a new webhook, and fill in the relevant information.
The Endpoint requries a web-accessible URL, where Teamup will send the webhook payloads
by using a POST request.
After the webhook configuration is saved, a secret value will be provided in the webhook settings. The secret is used as a shared key to compute a keyed-hash (or HMAC) of the webhook payload using the HMAC-SHA256 algorithm. This enables you to validate the data-integrity of the webhook's payload.
Note: for local development you can use tools to route internet traffic to your local development machine, such as:
- ngrok
- LocalTunnel
- pyjam (experimental)
Installation
Install the latest version with Composer:
$ composer require teamup/webhook-php
Usage
This library provides a Webhook class to handle the webhook requests and helpers
to parse and validate the received payload from Teamup.com.
An example implementation may look like:
$webhook = new Webhook(new Parser('my-secret')); $webhook->registerHandler(Trigger::Any, new MyLogHandler()); $webhook->registerHandler(Trigger::EventCreated, new OnEventCreatedHandler()); $webhook->handle($request);
You can also use directly the parser for a simpler approach:
$content = file_get_contents('php://input'); $parser = new Parser('my-secret'); // should throw InvalidSignatureException if the secret is incorrect or the data is corrupted $parser->verifyIntegrity( $content, getRequestHeader(Header::TeamupSignature->value), ); // If the integrity is verified, you can parse it or just process the raw payload $payload = $parser->parse($content);
teamup/webhook-php 适用场景与选型建议
teamup/webhook-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 12 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 teamup/webhook-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 teamup/webhook-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-16