title: 403 access denied for admin user using Magento REST API
body: <p>I am trying to access the Magento Rest api from Python. But at the last stage i am getting the {'messages': {'error': [{'message': 'Access denied', 'code': 403}]}}.</p>
  
  <p>But, the when i tried to access the same thing from PHP script it is working fine for me.So, there is no issue with the admin role and permission.</p>
  
  <p>One solution is <a href="https://stackoverflow.com/questions/13857981/error-while-using-rest-api-in-magento">here</a>, but it suggest to give all the roles to guest. Which can not be happen in my case as it will be open for all the user to fetch the product from browser.</p>
  
  <p>Could any one please suggest what can be the reason for not getting access the same Rest API from python but works fine with PHP.</p>
  
  <p>This is my code for Python script </p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>{AGENTO_HOST = 'http://127.0.0.1'
  MAGENTO_API_BASE = '%s/api/rest/' % MAGENTO_HOST
  
  magento = OAuth1Service(
      name               = 'magento',
      consumer_key       = 'vygdq11yzaectqwbpn1h4zwlamsrpomi',
      consumer_secret    = '5x5idvqc8rh4vc8lrxeg4hvple0u63dt',
      request_token_url  = '%s/oauth/initiate' % MAGENTO_HOST,
      access_token_url   = '%s/oauth/token' % MAGENTO_HOST,
      # Customer authorization
      #authorize_url     = '%s/oauth/authorize' % MAGENTO_HOST,
      # Admin authorize url depending on admin url
      authorize_url      = '%s/admin/oauth_authorize' % MAGENTO_HOST,
      base_url           = MAGENTO_API_BASE
  )
  
  # get request token
  request_token, request_token_secret = magento.get_request_token(method='POST', params={'oauth_callback': 'oob'})
  
  # authorize us
  authorize_url = magento.get_authorize_url(request_token)
  
  print 'Visit this URL in your browser: ' + authorize_url
  code = raw_input('Paste Code from browser: ')
  
  session = magento.get_auth_session(request_token,
                                     request_token_secret,
                                     method='POST',
                                     data={'oauth_verifier': code})
  
  headers = {'Accept': 'application/json'}
  r = session.get('products', headers=headers)
  
  articles = r.json()}
  </code></pre>
  
  <p>Any help will really be appreciated.</p>