//Required library
require('lib/FreshBooksRequest.php');
//setup Freshbooks API
$domain = 'test'; //
https://your-subdomain.freshbooks.com/$token = '##########'; // your api token found in your account
FreshBooksRequest::init($domain, $token);
//Pull in projects
$fbcallback = new FreshBooksRequest('callback.create');
$fbcallback->post(array(
'callback' => array(
'event' => 'project.create',
'uri' => 'A URI'
)));
$fbcallback->request();
if($fbcallback->success()){
//testing HTTP response
$teres = $fbcallback->getResponse();
echo 'response back from Freshbooks: ';
print_r($teres);
}else{
echo $fbcallback->getError();
print_r($fbcallback->getResponse());
}
?>
<br/>
Post Variable:
<?php if($_POST){
print_r($_POST);
update_option('freshbooks', $_POST);
}?>
Everything send to Freshbooks and I get a response of "ok" but I do not get a verification code sent back to me. I also see the web hook get created in my account. Can anyone see what I'm doing wrong?
Thanks!