Magento CE-

I am trying to use the REST API and when accessing (for example) http://my-domain.com/api/rest/customers the response is the following:

<?xml version="1.0"?>
        <message>Access denied</message>
        <trace>#0 /var/www/html/my-domain.com/app/code/core/Mage/Api2/Model/Server.php(106): Mage_Api2_Model_Server-&gt;_allow(Object(Mage_Api2_Model_Request), Object(Mage_Api2_Model_Auth_User_Guest))
#1 /var/www/html/my-domain.com/api.php(73): Mage_Api2_Model_Server-&gt;run()
#2 {main}</trace>

which is good, I mean the message is Access denied.

Is there a way not to print (hide) the <trace> tag?

1 Answer 1


you get a trace in your REST API return error if your store is set to developermode (Magento 1.9.x). So you probably have something like this in your index.php file:


In a live environment no trace will be send along with the error message.

But just in case you want to hide the trace in your developer mode store in, for instance, a custom REST API function, you could for instance add this:

protected function _create($orderline)
if (!$results['success']) {
  return $this->_critical($results['message'], $results['code']);

Sometimes a bit handy when you want to develop but the rest api consumer should not be able to see the trace... So remove the setIsDeveloperMode lines in a live environment :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.