title: Python - Get user purchases using Google API from GAE
body: <p>I'm trying to get a user's subscription using a google api call from server side (Google App Engine). I went over all the documentation I could find, but I couldn't clearly understand how exactly this should be done properly. So far I've tried the following :</p>
  
  <pre><code>    credentials = AppAssertionCredentials(scope='https://www.googleapis.com/auth/androidpublisher')
      http = credentials.authorize(httplib2.Http(memcache))
      service = build('androidpublisher', 'v2', developerKey='[DEVELOPER_KEY]', http=http)
  
      request = service.purchases().subscriptions().get(packageName='com.example', subscriptionId=self.orderId, token=self.token)
      response = request.execute(http)
      print json.dumps(response, sort_keys=True, indent=4)
  </code></pre>
  
  <p>But I'm getting the following response :</p>
  
  <blockquote>
    <p>HttpError: https://www.googleapis.com/androidpublisher/v2/applications/com.ichoose.bettercalls/purchases/subscriptions/incoming_and_outgoing_single_line_monthly/tokens/dfsdfdsfds?alt=json&amp;key=AIzaSyDdxzjIEZme76VEVMKGaE7R4qTdsQrNloA returned "Invalid Credentials"></p>
  </blockquote>
  
  <p>The developer key is taken from google developers console --> APIs &amp; auth --> Credentials --> Key for server applications --> API KEY. Is this right?</p>
  
  <p>I would appreciate if someone could explain clearly (preferably with code samples) how this should be done. Thanks a lot.</p>