Unauthorized when making POST request with ajax
See original GitHub issueHey, didnt find anything on this so Im asking.
The documentation says that in order to save data (or to get filtered data) you should use this:
fetch('/api/collections/save/posts?token=xxtokenxx', {...
However I am getting {error: 'Unauthorized'}
even though the supplied token is valid. I tried with the general token you find in the settings and admin api account token as well.
Im using the master branch.
Any insight on this is welcome. Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
401 Unauthorized on .ajax post - jquery - Stack Overflow
If this page is hosted in a Sitecore solution, which it seems like it is, the page request is probably going through the...
Read more >401 Unauthorized POST request with jQuery - Laracasts
I'm using jQuery script in one of my views to send POST request to my API route in Laravel 6: The request looks...
Read more >jQuery Ajax Unauthorized error on POST
I first get the form digest: var formDigest; $. ajax({ async: false, url: "https://#################/_api/contextinfo", type: "POST", headers: ...
Read more >Ajax API call - 401 Unauthorized Error - Customize with code
I'm creating a GET request from my square space site to Big commerce using ajax API call. But facing 401 unauthorized error.
Read more >web service error 401 at HTTP Basic Authentication with ...
web service error 401 at HTTP Basic Authentication with jQuery AJAX requests · 1.CREATE web SERVICE at sa 17 with Support WEB CORS....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Also just for the record there is a typo in the docs it says when retrieving filtered data the url is
/api/collections/save/posts?token=xxtokenxx
when in fact there should be GET instead of SAVE so:/api/collections/get/posts?token=xxtokenxx
is correct.OK it works now when I created new user and used its token. I feel like this is a “bug”? I will keep the issue open in case it is in fact a bug.
Cheers.