I have created some endpoints in a module that have a resource of "self"
When I call the request using a jQuery ($.post) I get an Not allowed to accesses resource "self". These requests are done on the onpage.phtml template.
Note: I am not sending customer token. Do you need this? You can then make this request from anywhere if you do use a token. Which breaks the statement that only AJAX calls can get a "self" resource.
Any help is welcome.