Google directory api always returns 403 - google-api

I am trying to use the Admin SDK Directory api to look up user profiles. I am able to do this successfully all day (with in quota) with 99% of the time. Though there are certain times where it just fails no matter what.
Yes I have set the service account user, I have the proper scopes, I have admin api turned on.
It even fails in the google api explorer. See screen shots
The call:
https://www.dropbox.com/s/9v9m6s5zf76oix7/call.png?dl=0
The response:
https://www.dropbox.com/s/te6k3x5xjkr467j/response.png?dl=0
Sorry for the links, images keep showing as broken

After contacting google they supplied an answer. There is a setting for the contacts app that enables and disables this.
Admin console >> Google Apps >> Settings for Contacts >> Advanced settings
Contact sharing: Enable contact sharing
Make sure that is enabled and it works.
Here is a screen shot: https://www.dropbox.com/s/8jmzz7zw0xq4ux4/answer.png?dl=0

Honestly, it just seems like some sort of transient error on the Google side. Being that it's working ~99% of the time for you, means you're not doing anything wrong. I would consider this more true b/c you're also using a Google Tool rather than your own so you know it's not the code. When it's failing for you, does it also then fail with the API explorer? What about with the OAuth Playground?
If this is reproducible consistently (same times, after X amount of requests, etc.), it would be worth reporting the the Google for Work Support team (assuming you have the ability to contact support) as it sounds like a bug and they would be able to help with break/fix for API issues.

Related

Could not execute google form api on google developer documentation

I got the below popup when I tried to execute the google form api from google developer documentation.
I tried this same process with google docs api which work perfectly. I tried tp turn on less secure app access, but it seems google made it unavailable.
what is the other way out.
Thanks
This appears to be a bug with the try me on forms.
I have logged it on the issue form and im going to see if i can find someone at google to ping about it
Forms.get try me not working
I suspect however that this may have something to do with the app being in early access. That being said i would have expected a different error message if that was the issue.
It is most likely due to the permission for the client they are using. It is an internal error and not something you have done.
May i suggest creating your own app and testing it that way. Just remember this api is in early access so be sure that you fill out the form found on this page Google Forms API now available in open beta
Developers can apply to join our Early Adopter Program and begin developing using the Google Forms API by filling out this form.

Google API Oauth consent screen stuck in verification for almost a year

I built a Chrome Extension using the Google Slides API ~8 months ago, with users having to sign in with the OAuth consent screen as to be able to use the extension. The extension has over a thousand users, and for the past weeks I've had reports of people seeing an error that says "Sign in with Google temporarily disabled for this app".
I checked and indeed the OAuth page was still "being verified", although it still said it would only take a few days / several weeks. I'm not using any sensitive scopes either, so it all seems very odd. If the app didn't meet the criteria I would have been rejected, but that doesn't seem to be the case.
So my question is, how can I get it verified, or if anything rejected so that I can make a new submission? I looked all over the place and I haven't found a way to get it unstuck. I'm pretty sure 8 months for verification isn't normal whatsoever.
Google seems to manually validate each OAuth screen. That's a long (and costly process), but to my experience, it generally takes 24 hours if you don't use any sensitive/restrictive scopes. As it's your case apparently, I presume your submission has probably being lost somewhere.
My recommendations:
Check in the Google Cloud Console the status of your OAuth Screen. After logged in Google Cloud console, click on the hamburger icon and select "APIs & Services" > "OAuth consent screen". At the top of the page you will see the status. If it's something like "pending verification", go to step 2. Otherwise, make sure the form is completed and submit it to verification again.
Search in your emails if you have been contacted by "api-oauth-dev-verification-reply [at] google [dot] com" (the address might slightly change as they use a ticketing solution). Maybe they tried to contact you but the email went to spam?
Get in touch with the OAuth team by emailing "api-oauth-dev-verification-reply [at] google [dot] com". Make sure to add your
Google Project number in your email, so they will be able to check
what's wrong.
Disclaimer: I don't work at Google. But I'm bit familiar with that process now :)

How can I let others read and edit a google sheet (not shared with them) using googleapi, without them having to download credential?

I am a beginner trying out api for fun.
The problem is, lets say, I want to write a simple windows program with golang to let my friends read and edit one of the sheets saved on my google drive. How can I do this without having them download a credential file?
What I want it to do is simply redirect them to the Oauth Page right away, and if their email address is one recognized by the app it will grant them access to that google sheet.
What i think you need is to integrate your go app with Oauth protocol.
More specifically, with the Google provider.
This is mainly 3 steps:
add the oauth client to your application
something like this: https://github.com/golang/oauth2
See their docs on how to do it.
go to google dev documentation and see how to integrate google auth flow into the client: https://developers.google.com/identity/protocols/OAuth2
I'm not sure if google has something more specific for google drive integration and/or go-lang client in particular. Please do some searching.
make the glue code on your go app so that the user can interact with this (the login button (or command, if it is terminal based), error messages, logout, etc)
More questions will appear when you start to do this, however it is a great example to learn Oauth as well.
General guidelines:
https all the queries or oauth is basically useless
oatuh has many auth-flows and you must choose which one(s) you support. use whatever google documentation recommends for m2m scenario (machine 2 machine)
log errors so that your friends can send you a log file for you to debug issues
maybe set some feature flag so that you can simply disable this feature to run/test localhost ? maybe useful? you decide.

Mozilla WebExtensions support for Firefox Profiles

I want to create a Firefox Addon using WebExtensions, that will;
Display user, list of already created Firefox profiles
Ability to switch Profile
Just like User Agent Switcher (it was built on top of Mozilla Addon SDK). Watch https://www.screencast.com/t/Zj4AkTmFfA
I am unable to find any api reference over https://developer.mozilla.org/en-US/Add-ons/WebExtensions to access profiles list or switch profile.
Not sure if Mozilla is going to remove accessing Firefox profiles from within WebExtensions like they have restricted access to Firefox preferences (about:config).
I'm afraid there is no API, at the moment, to deal with user profiles. Other than the list on MDN, there's a list of APIs that have been approved and are being implemented.
However, there is one mid-term possibility: you can file a bug to request the support for a new API. This doesn't necessarily mean that your request will be implemented, but it does mean that it will be at least discussed. There's a guide here on how to do that.
If none of these options address your situation, you can consider
filing an API request. Before you do, please keep in mind:
The goal of WebExtensions is not to support every use case from legacy extensions. In most cases, the functionality you need can be
built with WebExtensions APIs, but it requires some re-thinking and
modification.
Generic or very broad bugs are hard to turn into actionable issues. Try to limit the focus if possible.
We do try to review all incoming API requests, but it takes time, so please be patient.
Do a search to see if the bug exists already.
Still want to file a new API? You can do so here.
Please note that there are ideas for filesystem access post Firefox 57: this could potentially be used to at least show the different user profiles.

Setting Billable Limits

From the Google API Console: When trying to change the Billable Limits for the project under the Quota page, I keep getting the error: Your input was invalid.
The error message is not very informative, doesn't specify which input was invalid or why it was invalid.
I've experimented with this in IE, Firefox, and Chrome. I've also turned off all other APIs except for Custom Search API (which I'd like to increase the limit for) without any luck.
Has anyone else encountered this problem? how can it be solved?
(response from a Google employee)
This can happen if a "restricted" API is enabled on the project. "Restricted" APIs can only be seen by specifically enabled users. For instance, the Google Maps Javascript API v2 has been marked "restricted" because it was retired in 2013, and no user should see this API anymore (and instead, use v3).
Work is underway to remove the Google Maps Javascript API v2 from all the existing projects. A systemic fix is being worked on (internal Google reference #12001333), but in the meantime, if you see this error, the best workaround is to use a different API project.

Resources