cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We are making some updates so the Community might be down for a few hours on Monday the 11th of November. Apologies for the inconvenience and thank you for your patience. You can find out more 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: 

Re: Webhook to get the latest changes for each user in the notification

Webhook to get the latest changes for each user in the notification

Jay-Chung
Explorer | Level 3

I recived the body of notification as example listed below.

{
  list_folder: {
    accounts: ['dbid:AABRfEVfzNwPNP0tffaaZFQy...']
  },
  delta: {
    users: [1037..]
  }
}


However, I did not know how to access user changed file by /files/list_folder/continue or /files/list_folder.

3 Replies 3

Greg-DB
Dropbox Staff

To keep track of changes in the accounts of the users linked to your app, you should start by calling /2/files/list_folder and /2/files/list_folder/continue as necessary, following the instructions in the documentation to get the full state of the account. With each call, you should store the latest returned "cursor". The cursors are user-specific, so you should stored them identified by the user's account ID.

 

Then, each "dbid:..." string you receive in the webhook notification body is the account ID of a user with changes in their account.

 

You should then call /2/files/list_folder/continue again with the latest cursor you have stored for that particular user, which will give you the new changes since the last call to /2/files/list_folder/continue.

Jay-Chung
Explorer | Level 3

Hello Greg: 

Thanks for your response. I studies the api document later. However, there was somthing still confused me.
The api /2/files/list_folder needed path parameter and/2/files/list_folder/continue needed cursor parameter.
However, I did not know how to get them from the body of webhook notification which merely contained account ID.




Greg-DB
Dropbox Staff
For /2/files/list_folder, the path is whatever path in the account you want to list. To list everything, you would use the empty string "" to identify root.

For /2/files/list_folder/continue, the cursor is the last cursor your received from /2/files/list_folder or /2/files/list_folder/continue for that user. (You'll need to persist the cursor on your side, identified by the account ID.)
Need more support?