cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

dropbox isn't sending webhooks

dropbox isn't sending webhooks

ivan006
Helpful | Level 6

what i tried

the below code is my webhook endpoint

- it responds to the validation request

- and it generates and stores a timestamp into a file called "GTest.txt" each time a request is sent to this function/corresponding route

 

  public function webhook_endpoint()
  {
    $report_object = new report;
    $result = "";
    $file_content_prefix = "";

    if (isset($_GET['challenge'])) {
      $result = $_GET['challenge'];
      $file_content_prefix = "Challange";
    } elseif ($report_object->webhook_endpoint_authenticate() == 1) {
      $file_content_prefix = "Authenticated";
    } else {
      header('HTTP/1.0 403 Forbidden');
      $file_content_prefix = "Not authenticated";
    }

    $timestamp = date('Y-m-d h:i:s a', time());
    $file_content =  $file_content_prefix." ".$timestamp;
    $file_name = "GTest.txt";
    file_put_contents($file_name, $file_content);

    return $result;
  }

problem

- It validates and generates a timestamp for that request just fine

- but when i change a file in the app's dropbox folder it doesnt generate any new timestamps in my "GTest.txt" file which leads me to believe no webhook request was sent

- i'm editing the dropbox file both on my desktop and on dropbox online (i edited a test files content and name and also added a .png file) but no webhook request seemed to have sent. 😞

 

P.s

is this a glitch? if so please explain why this kind of glitch would happen?

 

 

1 Accepted Solution

Accepted Solutions

Re: dropbox isn't sending webhooks

ivan006
Helpful | Level 6

Ok i had to set an exception in my cross-site request forgery  middleware lol
https://www.youtube.com/watch?v=nGXo061pibU&t=890s

 

the webhook error messages in the app console is what save me! but it takes a couple of errors before it will log them unfortunately 😕

View solution in original post

In Part-9 of Laravel 6 Basics, we will learn about CSRF Protection in detail. We will keep experimenting with lot of functionalities in new Laravel 6 website...
3 Replies 3

Re: dropbox isn't sending webhooks

ivan006
Helpful | Level 6

Ok i had to set an exception in my cross-site request forgery  middleware lol
https://www.youtube.com/watch?v=nGXo061pibU&t=890s

 

the webhook error messages in the app console is what save me! but it takes a couple of errors before it will log them unfortunately 😕

View solution in original post

In Part-9 of Laravel 6 Basics, we will learn about CSRF Protection in detail. We will keep experimenting with lot of functionalities in new Laravel 6 website...

Re: dropbox isn't sending webhooks

Greg-DB
Dropboxer

I'm glad to hear you already sorted this out. Thanks for sharing your solution!

Re: dropbox isn't sending webhooks

Mohdsyafiq
New member | Level 2
public function webhook_endpoint()
{
$report_object = new report;
$result = "";
$file_content_prefix = "";

if (isset($_GET['challenge'])) {
$result = $_GET['challenge'];
$file_content_prefix = "Challange";
} elseif ($report_object->webhook_endpoint_authenticate() == 1) {
$file_content_prefix = "Authenticated";
} else {
header('HTTP/1.0 403 Forbidden');
$file_content_prefix = "Not authenticated";
}

$timestamp = date('Y-m-d h:i:s a', time());
$file_content = $file_content_prefix." ".$timestamp;
$file_name = "GTest.txt";
file_put_contents($file_name, $file_content);

return $result;
}
Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Mohdsyafiq New member | Level 2
  • User avatar
    Greg-DB Dropboxer
  • User avatar
    ivan006 Helpful | Level 6
What do Dropbox user levels mean?
Need more support?