定制 php-censor/flowdock-client 二次开发

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

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

php-censor/flowdock-client

最新稳定版本:2.0.0

Composer 安装命令:

composer require php-censor/flowdock-client

包简介

A PHP library to interact with the Flowdock API

README 文档

README

This library allows you to interact with the Flowdock API. Flowdock client is fork of Flowdock.

Basic Docs

Installation

Only 1 step:

Download Flowdock using composer

Add Flowdock in your composer.json:

{
    "require": {
        "php-censor/flowdock-client": "dev-master"
    }
}

Now tell composer to download the library by running the command:

$ php composer.phar update php-censor/flowdock-client

Composer will install the library to your project's vendor/php-censor directory.

Push API

Chat

<?php

use FlowdockClient\Api\Push\ChatMessage;
use FlowdockClient\Api\Push\Push;

$message = ChatMessage::create()
    ->setContent('This message has been sent with php-censor/flowdock-client PHP library')
    ->setExternalUserName('php-censor)
    ->addTag('#hello-world');

$push = new Push('your_flow_api_token');

if (!$push->sendChatMessage($message, array('connect_timeout' => 1, 'timeout' => 1))) {
    // handle errors...
    $message->getResponseErrors();
}

You can also do it in your console, look at the help message:

$ bin/flowdock send-chat-message --help

Some arguments are mandatory:

$ bin/flowdock send-chat-message your_flow_api_token "This message has been sent with php-censor/flowdock-client PHP library" php-censor

Some options are available:

$ bin/flowdock send-chat-message your_flow_api_token "This message has been sent with php-censor/flowdock-client PHP library" php-censor --message-id=12 --tags="#hello" --tags="#world" --options='{"connect_timeout":1,"timeout":1}'

Team Inbox

<?php

use FlowdockClient\Api\Push\Push;
use FlowdockClient\Api\Push\TeamInboxMessage;

$message = TeamInboxMessage::create()
    ->setSource('source')
    ->setFromAddress('test@test.com')
    ->setSubject('subject')
    ->setContent('This message has been sent with php-censor/flowdock-client PHP library');

$push = new Push('your_flow_api_token');

if (!$push->sendTeamInboxMessage($message, array('connect_timeout' => 1, 'timeout' => 1))) {
    // handle errors...
    $message->getResponseErrors();
}

You can also do it in your console, look at the help message:

$ bin/flowdock send-team-inbox-message --help

Some arguments are mandatory:

$ bin/flowdock send-team-inbox-message your_flow_api_token source "test@test.com" subject "This message has been sent with php-censor/flowdock-client PHP library"

Some options are available:

$ bin/flowdock send-team-inbox-message your_flow_api_token source "test@test.com" subject "This message has been sent with php-censor/flowdock-client PHP library" --from-name=php-censor --reply-to="test@test.com" --project=project --format=html --link="http://www.flowdock.com/" --tags="#hello" --tags="#world" --options='{"connect_timeout":1,"timeout":1}'

...and more features coming soon...

Contribution

Any question or feedback? Open an issue and I will try to reply quickly.

A feature is missing here? Feel free to create a pull request to solve it!

I hope this has been useful and has helped you. If so, share it and recommend it! :)

统计信息

  • 总下载量: 9.07k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-12-16