1. Go to this page and download the library: Download timacdonald/kumulos 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/ */
timacdonald / kumulos example snippets
use TiMacDonald\Kumulos\Api;
/**
* Create our api object instance.
*/
$api = new Api($key, $secret);
/**
* Call an API method on the object, passing in an associative array of values.
*/
$api->createUser([
'name' => 'Tim MacDonald',
'twitter' => '@timacdonald87',
'github' => 'timacdonald',
'website' => 'timacdonald.me'
]);
/**
* Check if it failed.
*/
if ($api->failed()) {
// deal with failure, perhaps with an exception
throw new Exception($api->response()->message(), $api->response()->statusCode());
}
/**
* Retrieve the response payload.
*/
$userId = $api->response()->payload();
// Check if it failed
if ($api->failed()) {
// deal with failure, perhaps with an exception
throw new Exception($api->response()->normalizedMessage(), $api->response()->normalizedStatusCode());
}