PHP code example of duellsy / phpflow

1. Go to this page and download the library: Download duellsy/phpflow library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

duellsy / phpflow example snippets




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);
}
BASH
curl -sS https://getcomposer.org/installer | php
php composer.phar install