We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.
Forum Discussion
오부경
8 years agoExplorer | Level 3
longpoll api returns always true when I added shared folder to my drive
When I added shared folder to my drive, longpoll api immediately returns true (no wait).
list_folder api for root folder returns new cursor and longpoll api by root cursor returns true.
When it returns true, I call list_folder api and save cursor.
and after few seconds, I will check changes using longpoll api and api returns true immediately, and I call list_folder again, again.
I thinks it will be make error called 'too_many_requests'.
So, I removed shared folder from drive, it works fine. (wait 30~90seconds and returns false).
- Greg-DBDropbox Staff
When calling list_folder, you need to check the has_more value in the response. If it's true, you need to call back to list_folder/continue with the last returned cursor to get more results. You can find more information on how this works in the documentation for list_folder:
https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
If you use a cursor that indicates has_more=true as you are doing, list_folder/longpoll will also immediately indicate that there are more entries to retrieve.
Once has_more is false, you can then save the cursor and use list_folder/longpoll to monitor for new changes.
- 오부경Explorer | Level 3
Thank you Greg.
I did already list_folder/continue and save cursor
I have no many files in root folder and sub folder. (each folder has 3-10 files)
my code works fine without shared folder.
longpoll returns true just when I add one shared folder.
Added shared folder has 3-4 files.
I did test longpoll about root folder, then returns true
I did test longpoll about all children folder in the root, then each longpoll returns false.
Only root folder longpoll returns true.
Ps : For test, I call api 'get_latest_cursor' for root folder(empty path), api returns always new cursor.
Sorry my poor English.
Thanks.
- Greg-DBDropbox StaffEven if you don't have many files in your account, it's possible the list_folder and list_folder/continue results will be paginated, so you should make sure your app is always checking has_more and calling back if it's true.
If the API isn't working as expected though, please share the API calls an unexpected output so we can look into it. Be sure to redact the access token, but please include the cursors. You can share privately here if you'd prefer:
https://www.dropbox.com/developers/contact
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,875 PostsLatest Activity: 5 hours agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!