PHP Wrapper for the FancyHands API originally written by Charles Zink (Github). (So thank him if it's helpful)
It has been updated for new API calls by Ted Roden Github (so blame him if it's broken)
The only requirement, other than PHP, is the pecl OAuth extension
sudo apt-get install pecl
sudo pecl install oauth
sudo pecl install oauth
Complete usage examples in Example.php
Getting everything ready.
// API Keys
$apiKey = 'YOUR_API_KEY';
$apiSecret = 'YOUR_API_SECRET';
// Initialize the API
$FancyHands = new FancyHands($apiKey, $apiSecret);
Create a standard request:
// create a standard request that expires tomorrow
$expire = strtotime("+1 day");
$std = $FancyHands->standard_create("Standard Request", Do something for me...", 3.0, $expire);
Add a message to the standard request:
$FancyHands->standard_messages_create($std->key, "I'm going to cancel this request");
Cancel it:
if($FancyHands->cancel($r->key)) {
print("Canceled!");
}
Get a list of all expired requests:
$query = $FancyHands->standard_get(null, $FancyHands::STATUS_EXPIRED);
foreach($query->requests as $r) {
print("[" . $r->status . "] " . $r->title . " (" . $r->uniq . ")\n");
}
Get a single request:
$request = $FancyHands->standard_get($std->key);
Create a custom request:
$customFields = array(
array(
'type' => 'text',
'required' => false,
'label' => "Test Field",
"description" => "Test Field Description",
"order" => 0,
"field_name" => "test_field"
)
);
$expire = strtotime("+1 day");
$request = $FancyHands->custom_create("PHP Custom Test", "PHP Custom Test...", 1, $customFields, $expire);
- A native CodeIgniter library.
- You can contact FancyHands developer support at api@fancyhands.com
- For help using or installing this wrapper, feel free to contact charleszink@gmail.com as well.