Google Search Console API suggests enabling API for unfamiliar project number - google-cloud-platform

I have an account that is the verified owner for a property listed in the Google Search Console. I'm working to set up API access to it. I have a principal created that has access to each of the Google Cloud projects that I intend to query the data from. I've enabled the Google Search Console API for each of these projects.
After I authenticate the principal via OAuth2 and use the access token (including the 'https://www.googleapis.com/auth/webmasters.readonly' scope) to make a POST request to the query endpoint, I get an error message back that reads in part:
Google Search Console API has not been used in project 256595xxxxxx before or it is disabled
I searched this number in my Google Cloud Console and manually clicked through each of my properties and it doesn't match any of the projects on my account. How do I identify which project this number is referring to and/or how do I change it to point to one of my own Google Cloud properties so I might access its API?
Note: This answer speaks to what it is I'm trying to do (but with Google Search Console API), except that the error doesn't reflect my project ID, so I'm stumped about how to move forward with enabling the API on it.

This didn't take long to solve. After listing all the projects in the Google Cloud CLI per the first half of the instruction here, I was able to identify the project as that which is used as the service principal to do the authentication in the first place (and not actually an account I intend to export any of the data to).

Related

how to set the Storage Access API?

When I test my app using a web preview, it shows the above page.
I do not know how to install it? Set? Storage Access API
Where to install Storage Access API?
Before you can use the Cloud Shell these are steps you should follow:
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note:
If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.
Go to project selector
Make sure that billing is enabled for your Cloud project. Learn how to check if billing is enabled on a project.
Then follow the following steps below to enable the API in your own Google Cloud project.
In the Cloud console, go to APIs & services for your project.
Go to APIs & Services
On the Library page, click Private APIs. If you don't see the API listed, that means you haven't been granted access to enable the API.
Click the API(look for Storage Access API) you want to enable. If you need help finding the API, use the search field.
On the page that displays information about the API, click Enable.
Reference:
https://cloud.google.com/shell/docs/run-gcloud-commands
https://cloud.google.com/endpoints/docs/openapi/enable-api#console
It might be already enabled but there is a bug in this page so you need to re-authenticate
Open developer tools in your browser and select Network
you will find a line starting with accounts.google.com open it and authorize cloudshell.

Google Sheet asking for authorization gets 401: deleted_client

I cannot seem to get past the Google Authorization pop that always returns Error 401: deleted_client.
I created a Google sheet script a while back and I need to get it working again. I made a GCP account and tried messing around with that for hosting the app but I realized I didn't need that so I deleted all of my projects and my billing account. But I still can't get past the Google Sheet error when it tries to authorize my account. This worked before I started anything with GCP and was fine.
I've seen other issues saying that there needs to have some fixes in the GCP account and that's fine and all but I do not want this connected to GCP at all. I will never use GCP again and I can't even find a way to shut down the account entirely without removing my Google account.
I've tried clearing all cache and cookies from chrome since the beginning of time like some others have suggested that doesn't fix the issue either.
Thanks in advance!
It's confusing but, if your script uses Google APIs you must associate the script with a Google Cloud Platform (GCP) project.
See Google Cloud Platform projects for an explanation of this relationship.
GCP projects are used to group enabled Google services, to provide identities and configure OAuth.
Please read the document but see (re)creating OAuth credentials.
You'll need to:
Create a GCP project
Enable Google services
Configure OAuth consent
DazWilkin lead me in the right direction!
The last thing that was needed was to go to the existing Google Sheet script, hit the gear in the left panel of the new editor, then change the GCP project number to match the GCP project I created with OAuth creds. Thanks again!

Unable to create the first GCP project via API

I'm trying to create a Dialogflow Agent via API, It require a GCP project that also have to be created via API.
Actually both works well when the end user has already been once in the GCP console and accept the new terms and services.
The problem is that I would like to create the agent without the end user to have to perform any action on Google Cloud Platform.
Before it was possible, but it seems Google added a new terms of services for APIs on the GCP console that pop up the first time the user log in.
My question is, do you think there's any possibility to accepte those terms of services via Oauth or any other possibility?
Seems like Dialogflow still does it well.. so it should be possible :p
TY.
As stated by #John Hanley the user must login to accept the TOS so that the user-entity is bound to the Terms. Here you may find all the information regarding Google APIs Terms of Service.

How to create Dialogflow agents automatically via REST API

I'm trying to build a Bot-as-a-Service platform and I will be using Dialogflow for NLP. One key thing that is giving me headaches is the possibility to create a new Dialogflow agent whenever a user signs up to my service (and therefore configure their FAQs, etc...). From my research I know that each agent is associated with one project, so I must create a project first, but here's the big thing: To create a project I need to authenticate accordingly to Google Cloud Authentication and therefore supply my credentials in case of OAuth2 (I don't want my user's to log in with my user account) and it's not possible to programmatically create API keys for new projects link here

"Unable to retrieve database locations" error when setting up Google cloud Datastore

I am trying to setup Cloud Datastore, in GCP. Upon selecting "Cloud Datastore", in console, I see the "Choose where to store your data" page, with this error:
"Unable to retrieve database locations
There was a problem retrieving the available storage locations for your data. Retry or return later to finish getting set up."
Has anybody encountered this?
I have encountered same and resolved as below. (Iam using free tier)
When you select a location in either product (Cloud Datastore or App Engine), you set the location for your entire Google Cloud Platform project. I choose location to set from App Engine.
From Home (on left side) --> App Engine --> Select a language (I have selected "python"). --> It prompts for location (I have selected "us-central") --> (press) Next
Thats it come out of the tutorial. Next time I selected Datastore, it worked fine.
Hope this helps (screens below)
SCREEN1
SCREEN2
SCREEN3
SCREEN4
I've encountered the exact same error. Some of the Google Cloud management tools are a bit buggy, gcloud included, they need more TLC and more users to report bugs to Google. The best way around the bugs is to either use the Firebase Console or the App Engine console. Either one of these two appear to be required to provide the missing management glue between the various Cloud products Google has. The Firebase console IMHO is superior to the app engine console, and that's what I would recommend using. You can create the DB from the Firebase console. it will also add Firebase to your project, giving you access to the Firebase CLI, which works very well and doesn't have all the bugs that gcloud CLI has.
Go to https://console.firebase.google.com/u/0/ to open the firebase console
Click on +Add Project and select the project you created using the Google Cloud Console.
This will prompt you to accept addind Firebase for this project. Click accept, it will enable access to the project via the Firebase emulator and firebase CLI, you definitely want this.
Under Develop in the left hand menu, select Database, from there you will be able to add the version you want. Keep in mind only the old firestore has an SLA, but the new native Cloud Datastore is better, it has the pub/sub on events on read/writes.
I use Firebase to manage microservices that are only accessible via special routing from other backends and don't use any Firebase client code, it's just so much easier to manage the functions and run them locally with the firebase emulator before deploying using the Firebase CLI. I've not had the same luck with gcloud or using the Google cloud console as opposed to the Firebase console. On the other hand, Firebase CLI, the emulator and the Firebase console are fantastic, pretty seamless experience. It's been a joy using them. I wish I could say the same about the Cloud console, I go in there only when truly necessary.