定制 drewm/frontapp 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

drewm/frontapp

Composer 安装命令:

composer require drewm/frontapp

包简介

Super-simple, minimum abstraction FrontApp API wrapper

README 文档

README

Super-simple, minimum abstraction Front API wrapper, in PHP.

In the style of my MailChimp wrapper, this lets you get from the FrontApp API docs to the code as directly as possible.

Requires PHP 5.4 and curl.

Installation

You can install frontapp using Composer:

composer require drewm/frontapp 

You will then need to:

  • run composer install to get these dependencies added to your vendor directory
  • add the autoloader to your application with this line: require("vendor/autoload.php")

Examples

Start by use-ing the class and creating an instance with your API key

use \DrewM\FrontApp\FrontApp; $FrontApp = new FrontApp('abc123abc123abc123abc123abc123');

Then, list all your inboxes (with a get on the inboxes method)

$result = $FrontApp->get('inboxes'); print_r($result);

Create an inbox (with a post to the inboxes method):

$result = $FrontApp->post("inboxes", [ 'name' => 'Support' ]); print_r($result);

Update a channel member with more information (using patch to update):

$channel_id = 'cha_123'; $result = $FrontApp->patch("channels/$channel_id", [ 'settings' => [ 'webhook_url' => 'https://example.com/hook' ] ]); print_r($result);

Remove a contact using the delete method:

$contact_id = 'ctc_123'; $FrontApp->delete("contacts/$contact_id");

Quickly test for a successful action with the success() method:

$result = $FrontApp->get('inboxes'); if ($FrontApp->success()) { print_r($result); } else { echo $FrontApp->getLastError(); }

Troubleshooting

To get the last error returned by either the HTTP client or by the API, use getLastError():

echo $FrontApp->getLastError();

For further debugging, you can inspect the headers and body of the response:

print_r($FrontApp->getLastResponse());

If you suspect you're sending data in the wrong format, you can look at what was sent to FrontApp by the wrapper:

print_r($FrontApp->getLastRequest());

统计信息

  • 总下载量: 113.99k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固