We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
Anton P
4 years agoNew member | Level 2
CORS error on any endpoint
After successful authorization and getting the token I try to test it by fetching basic '/user' endpoint and I always get CORS error. Chrome Browser.
1) with preflish request:
2) Without preflight request:
What am I doing wrong, please help!
OK, I figured that out. Silly mistake. Appears that 'api.dropboxapi.com/2/check/user'
is a POST method while I was sending a GET request. The mistake would be avoided if the documentation stated that it's a POST message instead of just specifying that in a curl example which I haven't looked at.
3 Replies
- Anton P4 years agoNew member | Level 2
OK, I figured that out. Silly mistake. Appears that 'api.dropboxapi.com/2/check/user'
is a POST method while I was sending a GET request. The mistake would be avoided if the documentation stated that it's a POST message instead of just specifying that in a curl example which I haven't looked at.
- Greg-DB4 years ago
Dropbox Community Moderator
Can you share the full error output for reference?
Looking at the screenshots though, I do see two things that should be corrected:
- You should use POST instead of GET.
- The /2/check/user endpoint is an RPC-style endpoint, so you should supply the API parameter ("query", in this case) in JSON in the request body, not as a URL parameter
- Greg-DB4 years ago
Dropbox Community Moderator
It looks like our messages just crossed. I'm glad to hear you already sorted this out, and thanks for the feedback!
About Discuss Dropbox Developer & API
Make connections with other developers814 PostsLatest Activity: 17 hours ago
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If 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!