Invalid_scope Error 400 for Google Indexing API

Hello,

I have a problem, I try to use HTTP 0auth2 request to auto index my wordpress blog content. It’s weird because few days ago I success to run it but now, it’s impossible.

Everytime I have Error 400 invalid_scope.

Here is my informations for connection :

Authorize URI : “https://accounts.google.com/o/oauth2/v2/auth” (I tryed with others too)
Token URI : “https://www.googleapis.com/oauth2/v4/token” (I tryed with others too)
Scope : "https://www.googleapis.com/auth/indexing "
Client ID : ***
Client Secret : ***

In my google cloud for API Services:
Publication : In production
Web Search Indexing API : Active

Credentials:
https://www.make.com/oauth/cb/oauth2
https://www.make.com/oauth/cb/google-custom
https://www.make.com/oauth/cb/google-restricted
https://www.make.com/oauth/cb/google-cloud-speech
https://www.integromat.com/oauth/cb/oauth2
https://www.integromat.com/oauth/cb/google-custom
https://www.integromat.com/oauth/cb/google-restricted
https://www.integromat.com/oauth/cb/google-cloud-speech

Error:
Some requested scopes were invalid. {invalid=[https://www.googleapis.com/auth/indexing ]}
Erreur 400 : invalid_scope

I don’t understand, so headache since 2 days…

1. Enable the API

Direct Link: Google Cloud console

2. Insert all the known Google Redirect URIs for your app

Direct Link: https://console.cloud.google.com/apis/credentials

How to create an OAuth app in GCP: https://www.make.com/en/help/tutorials/calling-google-apis-via-the--http-make-a-oauth-2-0-request--module ← FOLLOW THIS

Here are all the known redirect URIs you need for your Google Cloud Console OAuth app. If you set these up, you can reuse the same GCP app for other Google apps and modules on Make.

https://www.make.com/oauth/cb/oauth2
https://www.make.com/oauth/cb/google-custom
https://www.make.com/oauth/cb/google-restricted
https://www.make.com/oauth/cb/google-cloud-speech
https://www.integromat.com/oauth/cb/oauth2
https://www.integromat.com/oauth/cb/google-custom
https://www.integromat.com/oauth/cb/google-restricted
https://www.integromat.com/oauth/cb/google-cloud-speech

Once you’ve set these up, you can use/reuse the same Make connection for all the supported Google apps & modules on Make - you’ll only have to enable the respective APIs for your custom app in Google Cloud.

3. Publish your GCP OAuth2 app

Direct Link: https://console.cloud.google.com/apis/credentials/consent

You might need to set your OAuth application to “Production”, otherwise the credentials expire very frequently.

1. To do this, go to menu item “OAuth consent screen”

or click here https://console.cloud.google.com/apis/credentials/consent

2. Then click the button below if the Publishing status is not “In production”

4. Configure the HTTP OAuth2 module

You need a “Authorize parameters” key of redirect_uri with the above Make OAuth2 callback URL.

You can find the Client ID and Client Secret in the OAuth2 app you created in GCP, on the right-hand side of where you inserted the 8 callback URLs in step 2:

For more information, see https://www.make.com/en/help/apps/it-and-development/g-suite-admin#connecting-to-google-services-using-oauth2

1 Like

Thank you, working, I forgot to allow the scope in google cloud console…

2 Likes