You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dgmyrek edited this page Mar 21, 2018
·
4 revisions
Create a file in the project root called cli.php and add this. Be sure to update your_access_token_here.
<?phpheader('Content-Type: text/html; charset=UTF-8');
// include the SparkAPI core which autoloads other classes as necessaryrequire_once("lib/Core.php");
$api = newSparkAPI_Bearer("your_access_token_here");
$api->SetApplicationName("PHP-CLI-Example");
$api->api_base = "sparkapi.com";
Then launch php in interactive mode and load this file.
$ php -a -d auto_prepend_file=cli.php
You can now call any of the functions defined in lib/Core.php on $api.