on-internet
← Community

403 error in Google Indexing API (after trying all solutions from other SO questions)

Stack Overflow ·

I'm trying to use the Google Indexing API using the PHP client library. This is my code: $client = new Google_Client(); //use the private key that we created for our service account. $client->setAuthConfig(storage_path('google_auth_config.json')); //this works $client->addScope('https://www.googleapis.com/auth/indexing'); // Get a Guzzle HTTP Client $httpClient = $client->authorize(); $endpoint = 'https://indexing.googleapis.com/v3/urlNotifications:publish'; $content = '{ "url": "https://myverifieddomain.com/url", "type": "URL_UPDATED" }'; $response = $httpClient->post($endpoint, [ 'body' => $

Comments

Sign in or sign up to comment and upvote.

No comments yet.