Google Classroom - Getting Started - google-classroom

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.

Related

Using a Google Brand Account with internal OAuth API Project

I am currently creating an application for personal/internal use only that will help me upload and manage youtube videos on a number of brand accounts I have. Due to the internal nature of the application, I have listed the User Type on my OAuth consent screen is "Internal". I have set authentication up using OAuth Client ID and this works as expected for my main account.
However, when I attempt to use the same application for a brand account associated with that main account the authentication failed with the error "Error 403: org_internal" stating "This client is restricted to users within its organization.". The brand account I am trying to use is owned by the main account for which the authentication works and so I would expect this brand account to also belong to my organisation and therefore be able to use the application however this doesn't seem to be the case.
Is there something I can do to make my application work with this brand account, or some way I can associate my brand account with my organisation so that this works. I really don't want to have to go through verification for an external user type as this requires websites, privacy policies, terms and conditions and even a video detailing how the data will be used, which is massively overkill for an application I just want to use on my own personal account.
Thanks.

How to get authorization for accessing Google Play developer 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.

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 play developer console, howto add external linked project?

I am trying to use the Google Play Developer API to automate APK submissions via a Service Account.
The question is, how do I give my project (and my service account) OUTSIDE of this play account, API access to manage apps?
Use case and example:
Each of my clients have their own Google Play account where their app(s) live. Apps used to be all in one big account, but for many reasons (Google pushing to separate being the highest) they are now broken up.
Lets say there are 2 google play accounts, A and B. Traditionally, each of these accounts grant my physical email user (me#gmail.com) "Release manager" access to each of their accounts. My email/user is OUTSIDE of account A and B. This works fine.
I now want to automate this process. I go to the developer API console for me#gmail.com, enable "Google Play Android Developer API" and create an oAuth2 service account (gives it an email of blah#developer.gserviceaccount.com). I then tell clients to go into accounts (A and B) and tell them to give blah#developer.gserviceaccount.com "Release manager" access.
I make an API call and get
The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console
API calls do work if I go into account A and account B under Google Play Developer Console > Settings > API access, and make Services accounts for each. It makes an entry in "User accounts & Rights" for this service user's email, then links a SINGLE project ID that MUST be owned by the Google play account.
Questions:
How do I add a service account that is NOT defined in Settings > API access?
Why is there only ability to link 1 project?
You can give outside email addresses full perms, but you can NOT give an outside service account email API access? The current design is not any more secure. In fact, it seems to go against most of the benefit of the API, and against the grain of account isolation that Google has been pushing.

Google Marketplace SDK - Test Install Flow issue

I have created an app in the Google Apps Marketplace SDK and now I have the "Test Install Flow" button, which is fine,. however, when I click it, a popup for business account signup appears and asks me to set up a real Google business account. How can I simply test it with the same developer account I have?
Had the same issue. It occurs when you first log in to Google with a non-Google Apps account (like a free Gmail account), after which Google Apps accounts are added (i.e. are logged in).
As Ben Clifford suggests in comments, one needs to be signed in first with a Google Apps account (after logging out completely). As a best practice, use Google Apps accounts in one web browser, and free Gmail account(s) in a different browser - to avoid further issues.
You have to test it with a Google Apps account. Apparently yours is not one of those, so they're asking you to sign up. If you have a different Google account that has Google Apps already, you can add that account to the project in Permissions -> Add Member, and then use "Test Install Flow" while logged in as that other account.

Resources