cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in hearing how one of our Community members uses Dropbox for sailing trips? Read all about it 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: 

How to correctly use the /files/list_folder/continue endpoint to retrieve the latest added files?

How to correctly use the /files/list_folder/continue endpoint to retrieve the latest added files?

blueli
Explorer | Level 4
Go to solution

Hello

So basically I am working on automation. However, I cannot figure out how to use the "cursor" correctly.

My flow is simple. 

1. A webhook is triggered by new files added to Dropbox.

2. Use POST /2/files/list_folder to list all files from a specific folder and obtain a cursor.

3. Use POST /2/files/list_folder/continue with the cursor obtained in step 2. It will not return any results unless we continue with a cursor obtained before new files were added.

4. Upload those latest added files to somewhere else.

 

But how can we obtain the correct cursor (previous state) for step 3 to retrieve the latest added files for step 4?

 

Thanks

1 Accepted Solution

Accepted Solutions

Здравко
Legendary | Level 20
Go to solution

@ blueli wrote:

...

But I can only get the latest added items from the cursor from step 0 for the step 3 


According your explanation, that's what you try to do. Right? Correct me if I misunderstood something.

Once you keep the CURRENT last cursor, received from the last call to /2/files/list_folder/continue, the next time of execution with this cursor /2/files/list_folder/continue will give you the next changed things (files and/or folders). You have to save again the new latest cursor that will become the new current till the next change etc.

View solution in original post

5 Replies 5

Здравко
Legendary | Level 20
Go to solution

@ blueli wrote:

...

But how can we obtain the correct cursor (previous state) for step 3 to retrieve the latest added files for step 4?

...


Hi @ blueli,

You can do it in the same way as you have it done in step 2. 😉 The result has the same format.

Hope this helps.

blueli
Explorer | Level 4
Go to solution

0. Use POST /2/files/list_folder to list all files from a specific folder and obtain a cursor.  

1. A webhook is triggered by new files added to Dropbox.

2. Use POST /2/files/list_folder to list all files from a specific folder and obtain a cursor.

3. Use POST /2/files/list_folder/continue with the cursor obtained in step 2. It will not return any results unless we continue with a cursor obtained before new files were added.

4. Upload those latest added files to somewhere else.

 

But I can only get the latest added items from the cursor from step 0 for the step 3 

Здравко
Legendary | Level 20
Go to solution

@ blueli wrote:

...

But I can only get the latest added items from the cursor from step 0 for the step 3 


According your explanation, that's what you try to do. Right? Correct me if I misunderstood something.

Once you keep the CURRENT last cursor, received from the last call to /2/files/list_folder/continue, the next time of execution with this cursor /2/files/list_folder/continue will give you the next changed things (files and/or folders). You have to save again the new latest cursor that will become the new current till the next change etc.

Greg-DB
Dropbox Staff
Go to solution

@ blueli As Здравко said, you can save the latest received cursor (whether from /2/files/list_folder or /2/files/list_folder/continue) and call /2/files/list_folder/continue again later to get the new changes since then; at that point you can then save the new cursor returned by /2/files/list_folder/continue. You don't need to call /2/files/list_folder every time you get a webhook notification.

blueli
Explorer | Level 4
Go to solution

Thank you both of you. I understand it now

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    blueli Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?