PHP Library for Flowdock API use
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';
PHPFlow::pushToChat("flow_token", "Hello world!", "PHPFlow");
PHPFlow::pushToTeamInbox("flow_token", "the_source", "email", "the_subject", "the_content", array("tags" => "#important, hardwork, @everyone"));
$results = PHPFlow::getUsers("user_api_token");
if (false !== $results) {
print_r(json_decode($results));
}
$results = PHPFlow::getFlowUsers("user_api_token", "company", "flow");
if (false !== $results) {
print_r(json_decode($results));
}
$results = PHPFlow::getUser("user_api_token", "user_id");
if (false !== $results) {
print_r(json_decode($results));
}
$results = PHPFlow::getAllFlows("user_api_token");
if (false !== $results) {
print_r(json_decode($results));
}
PHPFlow::streamFlow("user_api_token", "company", "flow", 'callback');
// Must return strlen($data)
function callback($ch, $data)
{
print_r($data);
return strlen($data);
}
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);
}