olegf13/jivochat-webhooks-api
最新稳定版本:1.1
Composer 安装命令:
composer require olegf13/jivochat-webhooks-api
包简介
Library for Jivochat (Jivosite) Webhooks API integration.
README 文档
README
Library for Jivochat (Jivosite) Webhooks API integration.
This library allows you to integrate with Jivosite Webhooks API and:
- handle API calls in event-based manner;
- convert API requests JSON data in particular event objects;
- generate API responses;
- save original request (and generated response) data into MySQL or MongoDB server, and log it via Monolog.
For Russian documentation see README-ru.md.
Requirements
The library requires PHP 7.0 or above for basic usage.
Optional requirements:
- PDO extension allows logging of Webhooks request/response data to a MySQL server;
- Monolog library allows logging of Webhooks request/response using Monolog;
- MongoDB library allows logging of Webhooks request/response data to a MongoDB server.
It is strongly recommended to have at least one of above loggers installed to hold a "backup" of original requests sent via Webhooks API.
Installation
The preferred way to install this library is through Composer. To install the latest version, run:
composer require olegf13/jivochat-webhooks-api
Basic usage
<?php use Olegf13\Jivochat\Webhooks\Log\MySQLLog; use Olegf13\Jivochat\Webhooks\Event\Event; // create MySQL logger $dbLogger = new MySQLLog(new PDO('mysql:dbname=test;host=127.0.0.1', 'root', 'root')); // create Callback API event listener $listener = new Olegf13\Jivochat\Webhooks\EventListener([$dbLogger]); // bind listener for `chat_accepted` event $listener->on(Event::EVENT_CHAT_ACCEPTED, function (Olegf13\Jivochat\Webhooks\Event\ChatAccepted $event) { // here you do your stuff - find user in your database, etc $user = User::getByEmail($event->visitor->email); // generate response on Callback API $response = new Olegf13\Jivochat\Webhooks\Response(); $response->setCRMLink(...); $response->setContactInfo(...); $response->setCustomData(...); // event handler must return Response object return $response; }); // bind listener for `chat_accepted` event $listener->on(Event::EVENT_CHAT_FINISHED, function (Olegf13\Jivochat\Webhooks\Event\ChatFinished $event) { /** @var int Timestamp of the chat's first message. */ $chatBeginAt = $event->chat->messages[0]->timestamp; // ... return new Olegf13\Jivochat\Webhooks\Response(); }); // execute event listener $listener->listen();
Documentation
- Jivochat Webhooks API official documentation
License
This library is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
Thanks to this Jivosite Webhook handler library.
olegf13/jivochat-webhooks-api 适用场景与选型建议
olegf13/jivochat-webhooks-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14.88k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2017 年 04 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「jivosite」 「Jivochat」 「Webhooks API」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 olegf13/jivochat-webhooks-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 olegf13/jivochat-webhooks-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 olegf13/jivochat-webhooks-api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Makes your AmoCRM Webhooks looks pretty
Handle Zoom.us webhooks in a Laravel application
Production-ready third-party integrations for Laravel. Credential management, API request logging, rate limiting, sync scheduling, OAuth2, and health monitoring.
Library for parsing Jivochat (Jivosite) Webhooks API Requests into structured Model.
Library for Jivochat (Jivosite) Webhooks API integration.
Add webhooks to your Laravel app.
统计信息
- 总下载量: 14.88k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-04-20