cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right 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: 

/list_folder/longpoll not working with CORS

/list_folder/longpoll not working with CORS

dprothero
Explorer | Level 4
Go to solution

I see this was an issue 5 years ago, but that issue was reported as fixed. However, I am seeing the issue once again. I can call /list_folder no problem, as well as /list_folder/continue as you can see in my network trace below.

 

dprothero_0-1676074411005.png

However, I cannot call /list_folder/longpoll. The error in the console is the usual CORS error message:

 

"Access to fetch at 'https://api.dropboxapi.com/2/files/list_folder/longpoll' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled."

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

Unlike /2/files/list_folder and /2/files/list_folder/continue, the /2/files/list_folder/longpoll endpoint should be accessed on the 'notify.dropboxapi.com' host (not 'api.dropboxapi.com').

 

Please update your code to use 'https://notify.dropboxapi.com/2/files/list_folder/longpoll' and let me know if you're still running in to any issues.

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

Unlike /2/files/list_folder and /2/files/list_folder/continue, the /2/files/list_folder/longpoll endpoint should be accessed on the 'notify.dropboxapi.com' host (not 'api.dropboxapi.com').

 

Please update your code to use 'https://notify.dropboxapi.com/2/files/list_folder/longpoll' and let me know if you're still running in to any issues.

dprothero
Explorer | Level 4
Go to solution

I completely missed that in the docs. It's working beautifully now, thanks!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    dprothero Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?