Search console is not showing newly added (via API call) site. google-apis-explorer - google-apis-explorer

I have created my google service account and using it to make API calls. I am submitting site via API call at search console, call successfully completed with status 204 but site is not coming up in google search console UI.
Request URL is here
https://www.googleapis.com/webmasters/v3/sites/siteUrl

Related

Read Gmail POST Notification using Standard Google Cloud Platform (GCP) Script

I am trying to create a subscribing webapp using Google Scripts App to receive and decode POST notifications from Gmail API whenever a new email is received. The new changes in the Google Cloud Platform (GCP) is making it very hard to work. All the documentation/videos I have found about this are obsolete.
I created a script with a doPost() function directly from Google Drive (not linked to Google Docs, Sheets or Forms) and deployed it as a webapp with a provided link. I had to link the script with a standard GCP project as the default GCP projects which are automatically created for any Google Scripts App are not accessible anymore. The next step was to go to PubSub API in GCP, created a topic. When I try to create a subscription to allow the webapp to receive the POST messages from Gmail API, and set its delivery type to PUSH, an Endpoint URL is required. When I use the webapp link, I get the error:
The supplied URL is not registered in the subscription's parent project. Please see documentation on domain ownership validation.
I went throug the domain ownership validation and tried all possible solutions I found online without success. Without the PUSH subscription, I am unable to receive the notification, decode its body, get the email id then retrieve and decode the email body. Any help is highly appreciated.

Set Domain dynamically at Google auth2 API

I am using auth2 API for Authenticate users email which are showing on authentication popup.
After authentication from google it redirects the user to a success page of my site for further process.
That's why I need to create a redirect page and set the url to API configuration.
The redirect url also need to set in my Google API account.
After running the authentication API google matches the redirect url I have given with the url set to the Account.
Note: In Google API account multiple url of multiple domain can be set.
Now Question is, If my Script install in several Domain, I need to set that Domain to the App that I have created and Google Need to allow it.

Sending a message from FCM Console not working for Web Tokens

I am implementing Web Push Notification in an application and I have successfully registered the client app with GCM. I have the subscription object that contains the endpoint that looks like this.
"https://android.googleapis.com/gcm/send/dV4lSfI5J6Q:APA91bEU28F9YG5qNr3xSjvYlH2Mh1GPgiqMaRcjandHbpfqnVyAeZxqoE31OXYq4yzW2_vrkn74YHdgsITZP_6SELO8-xHf1hylquJefJdY85-Xx9AWTAPP9H6kfq7CKp23dsoQHbH
I read and found out that we need to use a third party library like web-push to send push using this endpoint to the clients because the payload needs to be encrypted according to spec. My objective is to send notifications to all my users, web + mobile, at once, using Firebase Console's Notification feature.
Is there a way to send push to web clients using Firebase console or to convert the GCM endpoint to an FCM token?
Update: If I try to use Firebase console to send push the token generated above, I get the following error.
As per testing this out, for some reason, registration tokens for Web are not working or allowed in the Firebase Console. Only tokens for Android and iOS do:
The request could still proceed where the console would show that it is sent/complete, but there wouldn't be any messages received.

Google Calendar API - 403 error

I am attempting to set up an application using the Google Calendar API. I set up all the credentials and set the authorized JavaScript page equal to http://localhost:8000 as suggested within the quick start guide at https://developers.google.com/google-apps/calendar/quickstart/js. When I try to run the file on localhost:8000/quickstart.html it will show the basis page but no information. I can click the authenticate button and it will allow me to authenticate my account to use the Calendar application, however nothing will show up information-wise. Checking the console, the following errors are present:
Get https://content.googleapis.com/calendar/v3/calendars/primary/events?maxResults=10&orderBy=startTime&showDeleted=false&singleEvents=true&timeMin=2017-08-11T20%3A58%3A29.156Z 403 ()
and
Uncaught {"error":{"errors":[{"domain":"usageLimits","reason":"accessNotConfigured","message":"Access Not Configured. Calendar API has not been used in project 440480151645 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/calendar.googleapis.com/overview?project=44080151645 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.","extendedHelp":"https://console.developers.google.com/apis/api/calendar.googleapis.com/overview?project=44080151645"}],"code":403,"message":"Access Not Configured. Calendar API has not been used in project 44080151645 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/calendar.googleapis.com/overview?project=44080151645 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."}}
However, going to the supplied link only says that I do not have access to the calendar.googleapis.com api and will not let me enable my Google Calendar or use it.
Google calendar uses Oauth2.0 for authorization. There are three essential components of this. If any of these are missing, authorization will not happen properly and you'll get a 403.
Access token - the google calendar API saves an access token to your
/.credentials folder by default. Your application will need to be
able to read this file (wherever it may be), otherwise you will have
to manually authorize API calls with every request.
client_secret.json - this is a necessary file to authorize your
application itself as a client of google. When you created a clientID and such using the google developer portal, this file was
created, and must also be read by your application.
Scopes - The scope is what level of access you have. It is by
default in the quickstart set to "read-only", which could be why
you're getting 403. If you want to change the scope, you're going to
have to edit both the line of code in the quickstart and either
modify the access token or get a new one to reflect that change.
I have gotten this error before, but that was before I understood Oauth2. If the problem isn't in any of these, it's likely something that you selected in the developer console. Let me know if you are still stuck.
Based from this thread, try setting the Referrers to Any referrer allowed for your project (just leave the field empty) in the Google Developers Console if it is not already like that.
To do this, go to your Google Developers Console and open API & Auth / Credentials and click Edit allowed referrers empty the input field.
Additional reference:
Google Calendar API v3 Access Not Configured
403 error with message:Access Not Configured. Please use Google Developers Console to activate the API for your project
Access Not Configured. The API (Google+ API) is not enabled for your project. Please use the Google Developers Console to update your configuration

How to prevent suspended Google account to signup

I am integrating ASP.NET application using Google Drive API. For this after authentication we re uploading Files to Google drive. I am using Google client library to Call the APIs.
Everything is working as expected I am able to authenticate user successfully and able to upload the file successfully.
In one scenario when the user Google account is suspended then I am getting refresh token from Google but my upload method is failing and it is not uploading the file to Google drive.
I want to restrict the user on Signup screen itself, when account is suspended.
What parameter do I have to pass to achieve this please suggest?
Unfortunately this info is not easily available. You have two options :
Use the Directory API to see if the user is suspended. This requires additional OAuth permissions to be provided by an admin of the domain.
At login, try and perform a Drive API call to see if you get an error or not. If you get an error (with a couple of retried) and the error message matches the one you had for suspended users, then you can deny access to the user.