Code Monkey home page Code Monkey logo

phpflow's Introduction

PHPFlow

PHP Library for Flowdock API use

Installation

Install composer in the project

curl -sS https://getcomposer.org/installer | php
php composer.phar install

Then insert composer autoload requirement line in your project

require_once __DIR__ . '/vendor/autoload.php';

Usage

Push message

Write message to CHAT

PHPFlow::pushToChat("flow_token", "Hello world!", "PHPFlow");

Write message to TEAM INBOX

PHPFlow::pushToTeamInbox("flow_token", "the_source", "email", "the_subject", "the_content", array("tags" => "#important, hardwork, @everyone"));

Users

Get all users

$results = PHPFlow::getUsers("user_api_token");
if (false !== $results) {
    print_r(json_decode($results));
}

Get flow users

$results = PHPFlow::getFlowUsers("user_api_token", "company", "flow");
if (false !== $results) {
    print_r(json_decode($results));
}

Get a user

$results = PHPFlow::getUser("user_api_token", "user_id");
if (false !== $results) {
    print_r(json_decode($results));
}

Flows

Get all flows

$results = PHPFlow::getAllFlows("user_api_token");
if (false !== $results) {
    print_r(json_decode($results));
}

Streaming

Stream message from a flow

PHPFlow::streamFlow("user_api_token", "company", "flow", 'callback');

// Must return strlen($data)
function callback($ch, $data)
{
    print_r($data);
    return strlen($data);
}

Stream message from flows

PHPFlow::streamFlows("user_api_token", array("company/flow", "company/flow2"), 'callback');

// Must return strlen($data)
function callback($ch, $data)
{
    print_r($data);
    return strlen($data);
}

phpflow's People

Contributors

flim avatar duellsy avatar

Stargazers

Charles Johnson avatar Erich avatar Eangelica Aton avatar Dejan Ranisavljevic avatar

Watchers

 avatar James Cloos avatar

Forkers

duellsy

phpflow's Issues

Conventions

  • you should remove require statement
  • you must use composer to handle autoloading
  • file name must be in a valid namespace directory (see PSR-0)
  • the class keyword must be removed
  • you need to add PHPUnit tests
  • add proper PHP Doc

PHPFlow

This class should not old static methods ... the constructor need to take the credential information to push to the correct flow ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.