cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We love to hear how every person gets the most from Dropbox, and it seems everyone has a slightly different use for it - tell us yours 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: 

retreive latest cursor

retreive latest cursor

Bingo974
New member | Level 2

https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/The-Cursor-of-a-user/m-p/532590#M25670

 

Ok for the basic flow but could you please specify this point  :  "the app recieves the webhook notification for that user and looks like up the last received cursor for that use". 

 

I don't understand how to guess the latest cursor. 

 

I can keep in memory all cursors/directory but how to guess which one to check ?

 

Here is an exemple :

 

directory1 (built with api)

- directory12 (built with api)

- directory13 ( dropbox user client )

- directory131 (dropbox user client )

-- files1  (dropbox user client )

- directory132 (dropbox user client )

-- files2 (dropbox user client )

-- files3 (dropbox user client )

 

Here is the notification I receive for each changes : 

{"delta": {"users": [123456789]}, "list_folder": {"accounts": ["dbid:ABCDEFGABCDEFGABCDEFGABCDEFG"]}}

 

How can I retreive the latest cursor to call listFolderContinue on the correct folder ?

 

It's not a good idea to loop listFolderContinue on all directrices to detect changes on each notifications...

I did not find a function to retrieve the last cursor of a user...

 

Thanks for your help

 

2 Replies 2

Re: retreive latest cursor

tahsini
Dropboxer

You could initially call list_folders (and /continue) with the recursive option being true, and store the cursor returned. Then when you receive a webhook, calling the cursor again will give you back changes for all the subfolders as well. 

 

Alternatively there is the method list_folder/get_latest_cursor which will return the latest cursor for a designated folder and also has the optional recursive parameter. 

 

If you have not already read it, our Detecting Changes guide covers cursor management.

Re: retreive latest cursor

khalifaburaak
New member | Level 2

I read it really helpful. I solved my problem.

Thank You

Who's talking

Top contributors to this post

  • User avatar
    khalifaburaak New member | Level 2
  • User avatar
    tahsini Dropboxer
What do Dropbox user levels mean?
Need more support?