cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and 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: 

I created a new App, scoped folder, getting cursor is not workig

I created a new App, scoped folder, getting cursor is not workig

raiam
New member | Level 2

I just created an app, to be used to listen for changes or new files in there.

 

This one automatically created a new folder called `test-implementation`, (name of my app as well), I am adding files in there, I see the webhook getting in, but I am not in a position to save cursors, so I am using `filesListFolderGetLatestCursor` (nodejs sdk), and it requires a path.

 

I have tried several, including `/test-implementation` or `home/apps/test-implementation` and none works, they throw path not found error, the only working is '' but it does not detect changes in there with the latest cursor from that path.

 

So not sure what is the right path to use, need urgent help 😞

2 Replies 2

Здравко
Legendary | Level 20

@raiam wrote:

..., I am adding files in there, I see the webhook getting in, but I am not in a position to save cursors, so I am using `filesListFolderGetLatestCursor` (nodejs sdk), and it requires a path.

...😞


Hi @raiam,

You have to be in position to save cursors!!! Otherwise you can't track any change! If you just take the latest cursor for particular account, it's latest already so when you try to continue, it will end up since there is nothing more. In such a situation you will have jumped over your changes (those you want to catch). 😉 Pay attention. Start listing or getting latest cursor should be at the system  initialization, not on hook handling. After that only continue listing should be used and previous saved cursor to be used as input. The resulted cursor should be saved for the next handling. No any paths have to be used as input to changes detection (paths are result of detection)!

Hope this gives direction.

Greg-DB
Dropbox Staff

@raiam As Здравко said, you'd need to be able to save cursors in order to keep track of changes over time. If you're calling filesListFolderGetLatestCursor after the webhook notification, that cursor will be for the point in time after the changes occurred, so you can't use that cursor to see those changes.

 

To start listing items, you should start with filesListFolder and iterate through with filesListFolderContinue as needed. Refer to the linked documentation for more information on how to use those. Ideally, you would store the last cursor you get each time, but you can start the entire listing, starting with filesListFolder, whenever needed.

 

As for the path, you can use the empty string "" to list the root for your app, and then check the results for the other path values you can use for other items.

Need more support?
Who's talking

Top contributors to this post

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