Php siteye Google index api kurulumu yaptım, ancak $link değişkenini kullanamıyorum. Nerede hata yapıyorum acaba.
<?php
require_once 'autoload.php';
$link = "https://siteadi.net/test-test";
$client = new Google_Client();
// service_account_file.json is the private key that you created for your service account.
$client->setAuthConfig('geopa-346408-287ffcc26f34.json');
$client->addScope('https://www.googleapis.com/auth/indexing');
// Get a Guzzle HTTP Client
$httpClient = $client->authorize();
$endpoint = 'https://indexing.googleapis.com/v3/urlNotifications:publish';
// Define contents here. The structure of the content is described in the next step.
$content = '{
"url": $link,
"type": "URL_UPDATED"
}';
$response = $httpClient->post($endpoint, [ 'body' => $content ]);
echo $status_code = $response->getStatusCode();
?>