cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Discuss Dropbox Developer & API

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

webhook not getting file or folder information like added or deleted from dropbox

webhook not getting file or folder information like added or deleted from dropbox

aalok
Explorer | Level 4

Currently, I am using dropbox-Php-SDK Kunal Verma. webhook URL added in dropbox console. at the change of file or folder, the webhook gets active.

 

  $listFolderContents = $dropbox->listFolder("/",[ "include_deleted"=> false,"include_has_explicit_shared_members"=> false,"include_media_info"=> false,"include_mounted_folders"=> true,"include_non_downloadable_files"=> true,"path"=> "/",'recursive' => true]);
        print_r($listFolderContents);
        $cursor = $listFolderContents->getCursor();
        $listFolderContinue = $dropbox->listFolderContinue($cursor);


        $post_dump = print_r($listFolderContinue, TRUE);
        $fpost = fopen('logs.txt', 'w');
        fwrite($fpost, $post_dump);
        fclose($fpost);
 
then I am trying to get the cursor and send it to listFolderContinue function but getting blanck entry 
response :

Kunnu\Dropbox\Models\MetadataCollection Object
(
[data:protected] => Array
(
[entries] => Array
(
)

[cursor] => **********************_NTiXkJp_ZcSFBt5NwY_Hvum1NbUA4aMwMr5A_A9-oL_usI65mlvlg0K4E1rElQMXXOBjqTEcEV37HTxB-StFmr1j3t9li7LLHI9DRmfbywU3OXCZoH6yzYEbATNcug2Nd1XuHxM-jC6SmdY4Aj3oeZVaQ9R5hkDVLPCiw4h_dtOEtdE
[has_more] =>
)

[items:protected] => Kunnu\Dropbox\Models\ModelCollection Object
(
[items:protected] => Array
(
)

[escapeWhenCastingToString:protected] =>
)

[cursor:protected] => ********************NTiXkJp_ZcSFBt5NwY_Hvum1NbUA4aMwMr5A_A9-oL_usI65mlvlg0K4E1rElQMXXOBjqTEcEV37HTxB-StFmr1j3t9li7LLHI9DRmfbywU3OXCZoH6yzYEbATNcug2Nd1XuHxM-jC6SmdY4Aj3oeZVaQ9R5hkDVLPCiw4h_dtOEtdE
[hasMoreItems:protected] =>
)

1 Reply 1

Greg-DB
Dropbox Staff

Is this output just the $post_dump that you're saving to logs.txt? If so, it looks like that only includes the result of the listFolderContinue call, but not listFolder. While you do need to implement both, in this case it's possible all of the results are being returned by listFolder, and so there's nothing left to return by listFolderContinue. You should always check 'has_more' to see if you need to call back for more entries or not.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?