from this docs : https://developers.google.com/identity/protocols/oauth2/service-account
i do it by using nodejs by folow these step
- create a new service account, and got an email.
- call
https://oauth2.googleapis.com/tokento get an access token and then i got theid_token. - i put the
id_tokento headers likeAuthorization: Bearer ${id_token}. - but when i called the
https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.products/get, i have got an error like this : { error: { code: 401, message: 'Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.', errors: [ [Object] ], status: 'UNAUTHENTICATED' } }
- am i do anything wrong? ,please give me some advice.
i just want to get an status of an in-app purchase from my server.