title: Getting user license in Google Apps Marketplace - Error
body: <p>According to the new <a href="https://developers.google.com/apps-marketplace/v2/reference/" rel="nofollow">Google Apps Marketplace documentation</a>, in order to get the status of a user license, it should be enough to make a simple <code>GET</code> request to <a href="https://www.googleapis.com/appsmarket/v2/userLicense/%7BapplicationId%7D/%7BuserId%7D?key=%7BApiKey%7D" rel="nofollow">https://www.googleapis.com/appsmarket/v2/userLicense/{applicationId}/{userId}?key={ApiKey}</a> where <code>applicationId</code> is a number, <code>userId</code> an email and <code>ApiKey</code> a string taken directly from the Google Cloud Console under <code>APIs -&gt; {App name} -&gt; Server Key -&gt; Api Key</code>.<br> I have also enabled the Google Apps Marketplace API in Google Cloud Console.<br></p>
  
  <p>However, I always get the following error message:<br></p>
  
  <pre><code>{"error":
  {"errors":[{"domain":"global","reason":"authError","message":"Invalid OAuth header","locationType":"header","location":"Authorization"}],
  "code":401,"message":"Invalid OAuth header"}}
  </code></pre>
  
  <p>Can you help me?</p>
  
  <p>EDIT: Following Arun Nagarajan's suggestion, I tried using a scope, but it still does not work. Here is my code (in Python on Google Appengine):</p>
  
  <pre><code>credentials = oauth2client.appengine.AppAssertionCredentials(scope='https://www.googleapis.com/auth/appsmarketplace.license')
  http = credentials.authorize(http=httplib2.Http())
  client = apiclient.discovery.build('appsmarket', 'v2', http=http, developerKey='XXXXXXXX')
  entry = client.userLicense().get(applicationId='123456', userId='some_user@email.com').execute()
  </code></pre>