How to get authorization for accessing Google Play developer API - google-api

I am trying to access Google play developer API https://developers.google.com/android-publisher/ to build an inapp purchase product for my company Application.
We have to get authorization to make a GET call to the Google play developer API. https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get
I followed the steps presented here. https://developers.google.com/android-publisher/authorization
Created an Oauth client and and also service account. The gmail account I used was part of the 'Users and permissions' in play.google.com console.
But when I tried to access the API, I got an error
As I started searching about this error, I understood that there is something else called 'API Access' in play.google.com. When I tried to access it, All I saw was
But I saw in other posts that there exists a screen with details like
https://i.stack.imgur.com/Hdjjy.png
So how can I go forward to access API. I did everything as mentioned in documentation of google but it didnt work. Also I dont have access to see the screen of 'API Access'.
Also I am confused, if you can create service accounts from both 'API Access' screen and also from 'credentials' screen in console.developers.com, which one should be used ?

Just to check you understand there are a few different APIs to do with in-app purchases.
Play billing library is designed to be used in your app. This is what allows users to buy things from your app
Configuring in app products. When your app supports in-app products you have to support what the products are and the prices. This is done via the Play console, either manually or in batches uploading CSV files.
Finally is the API you refer to in your question. This is not designed for use in your app, and you don't have to use it to support in-app products. Instead this API allows your server (not app) to validate a user's purchase. In order to use this API, you need to enable the "API access" in the page you found. This can only be enabled by the account owner for the Play console, for security reasons. You will need to find the Owner of your Google Play account, and get them to log in and create a service account which has API access.

I am able to access it now. I am not the owner of the Google Play console.That was the issue. You just have to go to API Access page and click on "create OAuth Client" or "create Service Account ".
You can use those credentials to access API from postman or through your code.

Related

Access to Google Play Developer API "as a service"

I'm developing a service that requires access to the Google Play Developer API on behalf of my users.
I created an API project of type Web Application. It can successfully request the users' androidpublisher permission using an OAuth consent screen. Based on the documentation, it should be able to make requests to the Google Play Developer API.
But requests to the API fail with the following error:
The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.
From my understanding, the API Project needs to be linked to the Google Publisher Account from the Console (Settings -> API access -> Linked projects). However, the project doesn't appear in the list (since it's not owned by the user).
Is there any solution to this? Thanks!
There is not a solution to this. The only model the console supports for acting on behalf of developer users is for them to create the project in the Play Console, and you provide them a tool that they can use on their project.

Google API to retrieve information about an OAuth app

How can I programmatically retrieve information about an OAuth client given its appId (xxxx.apps.googleusercontent.com). I am interested in retrieving Google API scopes the app is requesting (e.g.: https://www.googleapis.com/auth/userinfo.email) along with marketplace ratings and user coun t (if applicable).
Screenshot
I believe you can only access those stats if you own the app/add-on. Assuming that you're working on a GSute add-on, if you deploy the app via GSuite Marketplace you'll have to explicitly specify the scopes your app requires and you can check those scopes from your Google Console. I believe that there is also a dashboard available to the app developer (probable from Google Console) with analytic data related to performance.

I keep getting an error that my app needs to be verified when either I or another user try to authorize with OAuth2. What does that mean?

I received this error when trying to authorize my app with my own account:
Your project is trying to access scopes that need to go through the verification process.
{invalid=https://www.googleapis.com/auth/contacts}
If you need to use one of these scopes, submit a verification request. Learn More
When I use a different account, the error message is different:
This app hasn’t been verified to access:
{invalid=https://www.googleapis.com/auth/contacts}
Are you the developer? If this project needs these scopes, sign in to an account with access to edit your project and try again.
If not, contact the developer for help.
As per the announcement on May 11, 2017, publicly available applications with access to certain user data must pass review. If you see an access error for your app, submit a request using our OAuth Developer Verification form.
For personal-use apps and those you are testing, join the Google group Risky Access Permissions By Unreviewed Apps, which allows you to approve data access for personal and testing accounts. See the Google API Services User Data Policy for more information.
UPDATE: Corrected broken link to form.

Google Classroom - Getting Started

I am just getting started with the google classroom api. I signed up for the developer test accounts and have 1 teacher account and 2 student accounts. I created a couple of classes and enrolled the 2 students in the classes. I want to use the api either via .NEt or Javascript. The prerequisuites state that I need a Google Apps for EDU account with Google Classroom enabled. How do I get this? Also, I assume without having the Google Apps for EDU account I cannot perform the first step:
"a) Use this wizard to create or select a project in the Google Developers Console and automatically turn on the API. Click Continue, then Go to credentials."
When I perform this step when logged in under the teacher account I get an error:
Error
"Developers Console has not been activated for your account. Your account may be suspended or disabled. If you are a Google Apps user, ask your domain administrator to enable Apphosting Admin on your account."
To obtain a Google Apps for Education account, you have to register your domain (or buy one), and fill up this form.
When filling the form, you will get information about the requirements needed to get the account.
To create a project in the Developer Console, you can do it even from your gmail account. After you created the project, you can enable the Classroom API so you application can access it.
When you run the code, you will have to login with a valid account (teacher or student). If you try to access the API with an invalid account you will get an error.
You can also use the Classroom API methods in the documentation. For example the resource curses.list has a "try it" section, where you can try the API before creating any project. There you can see how it works.

Google OAuth/Google+ Api with multiple account

Spent the whole day to explore this ... api. But did not get the desired result.
Task - allow user login to my site with google account.
I have two google account. I want select what account use.
I read this doc
But this not allow select account and use "default"
I try use gapi.auth.authorize({..., authuser: -1}). This allow select account but ... i must twice select account.
I can`t find documentation about /AccountChooser
How I can correctly login with select needed account?
I find next solution - my code my blog
I use this docs Google OAuth API
Call https://accounts.google.com/o/oauth2/auth ton get access_token
With https://www.googleapis.com/oauth2/v1/userinfo?access_token= get user details
I was struggling with this problem on iOS, create a framework for it. https://github.com/Thywis/MultiAccountOauth
Basically, you have to sign in and restore the credential for multiple account, but I'm not sure why the Google iOS framework doesn't allow you to do this.

Resources