Neil Neil - 2 years ago 91
JSON Question

Magento - Create AJAX endpoint that does not require a key

Im trying to create and endpoint in Magento that can be accessed externally. So I have this in my module controller

public function jsonAction()
$json = json_encode(['test' => 'test']);
$this->getResponse()->setHeader('Content-type', 'application/json');

If I use the below

$test = Mage::helper("adminhtml")->getUrl("test/test/json");

it generates a url with a key on the end and then the url like below:

This works as expected and the JSON is returned.

The problem is that I need to be accessible from an external site that wont be able to generate the key so Im trying to get it to work just with

Any help would be much appreciated

Magneto module config.xml


Answer Source

I resolved this issue by creating a SOAP endpoint and on extension installation I create a Soap user with the correct roles to use the endpoint

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download