Callback.verify not sending verification

140 views
Skip to first unread message

Eric Hoanshelt

unread,
Dec 5, 2012, 4:55:55 PM12/5/12
to freshbo...@googlegroups.com
//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!

Anton Nguyen

unread,
Jan 16, 2013, 8:33:32 AM1/16/13
to freshbo...@googlegroups.com
Hey Eric!

The callback.verify call actually doesn't send the verification. Its the callback.create or the callback.resendToken calls that does it. When you invoke either of those calls, it'll send the verification token to the URL that you specified. This is to ensure the URL is valid and helps you figure out whether or not it can receive webhooks. 

Once you check your server for the verification token, you can send it to the callback.verify call, and when you check your FreshBooks account, it should say 'verified' next to the web hook. At this point, you're done and you'll start receiving webhooks for the system events you specified.

Lemme know if you have anymore questions!
Anton

Awais Qarni

unread,
Nov 17, 2015, 2:15:32 AM11/17/15
to FreshBooks API (not monitored)
Hi,
I am having same problem. I am not receiving any response from freshbook against my callback.create call. I have even manually send verification code from freshbook account but I am not receiving any code from freshbook. 
Reply all
Reply to author
Forward
0 new messages