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 :
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)
But I'm getting the following response :
HttpError: https://www.googleapis.com/androidpublisher/v2/applications/com.ichoose.bettercalls/purchases/subscriptions/incoming_and_outgoing_single_line_monthly/tokens/dfsdfdsfds?alt=json&key=AIzaSyDdxzjIEZme76VEVMKGaE7R4qTdsQrNloA returned "Invalid Credentials">
The developer key is taken from google developers console --> APIs & auth --> Credentials --> Key for server applications --> API KEY. Is this right?
I would appreciate if someone could explain clearly (preferably with code samples) how this should be done. Thanks a lot.