Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to get value of core_config_data eg. general/region/state_required using Magento soap api?

share|improve this question
up vote 5 down vote accepted

Create A Custommodule:

Api File(Api.php)

class Amit_Customapi_Model_Api extends Mage_Api_Model_Resource_Abstract
        public function myregion()
             $countryList = explode(',', Mage::getStoreConfig(general/region/state_required));

        return $countryList;

and etc/api.xml is

<?xml version="1.0"?>
            <customapi_api translate="title" module="customapi">
                        <myregion translate="title" module="customapi">
                            <title>Require Region</title>
                <customapi translate="title" module="customapi">
                    <myregion translate="title" module="customapi">
                        <title>Require Region</title>

You can access by below url


$client = new SoapClient('http://yourhost/api/soap/?wsdl');
$session = $client->login('******', '******');
$date = $client->call($session, 'customapi_api.myregion');


$client = new Zend_XmlRpc_Client('http://yourhost/api/xmlrpc/');
$session = $client->call('login', array('******', '******'));
$date=$client->call('call', array($session, 'customapi_api.myregion'));

Edit: Full module

File:config.xml and 

code of this file:

<?xml version="1.0"?>
share|improve this answer
Thanks Amit for such a detailed answer. I tried creating custom module as you mention (Also added blank Helper/Data.php and assign role 'Required Region' to user ) but it says 'Access Denied'. I don't know what went wrong – ganesh Aug 22 '14 at 10:30
I need to create helper class.then reset admin permissio – Amit Bera Aug 22 '14 at 10:52
What I did is created Helper/Data.php with <?php class Amit_Customapi_Helper_Data extends Mage_Core_Helper_Abstract { } But still it says 'Access Denied'. What do you mean by 'RESET admin permisssion' – ganesh Aug 22 '14 at 10:59
If Webservice - SOAP - Resource Roles selected to All then output is correct, but if Resource role selected to Custom and checked Required Region then output is Access Denied. Any Idea how to fix this? – ganesh Aug 22 '14 at 12:37

You can't.

But what you can do is create your own SOAP API callable function/extend SOAP API.

The (current) details are published here:

Then you can make Magento do what you need.

There may be a module out there already that exposes parts if not the whole of core_config_data but it's unlikely!

The Core Config Data is a odd one to expose on the API as it contains most of the keys to the empire. So if you do extend to get data from here, make sure it's read only and restrict it to a set of keys. Say general/region/*

share|improve this answer

protected by Amit Bera Apr 27 '15 at 19:54

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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