定制 sun-asterisk/chatwork-php 二次开发

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

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

sun-asterisk/chatwork-php

最新稳定版本:v0.2.0

Composer 安装命令:

composer require sun-asterisk/chatwork-php

包简介

Chatwork API PHP client library

README 文档

README

Build Status Latest Stable Version Codecov GitHub

Requirements

  • PHP >= 7.0
  • PHP cURL

Installation

Using composer:

composer require sun-asterisk/chatwork-php

Usage

You may register an API Token here.

Create a chatwork client with an api token or an access token:

use SunAsterisk\Chatwork\Chatwork;

$chatwork = Chatwork::withAPIToken('your-api-token');

// $chatwork = Chatwork::withAccessToken('your-access-token');

Use chatwork client methods as these examples below:

// Get your personal information.
$me = $chatwork->me();

// Get your personal tasks.
$tasks = $chatwork->my()->tasks();

// Get members in a room.
$members = $chatwork->room($roomId)->members();

API methods are organized similar to the official API doc e.g.

Message builder

There's a helper for easily creating message.

use SunAsterisk\Chatwork\Helpers\Message;

$message = new Message('Hi there')
    ->info('Cloudy', 'Weather today');

$chatwork->room($roomId)->messages()->create((string) $message);

You can also access it via a static method of the Chatwork class.

$message = Chatwork::message('Hi there');

Verify webhook payload

There's also a helper for verifying the webhook payload signature.

use SunAsterisk\Chatwork\Helpers\Webhook;

$isValid = Webhook::verifySignature($yourWebhookToken, $requestBody, $signature);

统计信息

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

GitHub 信息

  • Stars: 22
  • Watchers: 1
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-04