Пакетные запросы Google Indexing API в PHP - 404 Ответ не найден
Я делаю плагин API индексации Google для веб-сайта вакансий (WordPress на AWS CloudFront). Я использую google-api-php-client и google-api-php-client-services.
require_once plugin_dir_path( __FILE__ ).'/vendor/autoload.php';
$client = new Google_Client();
$client->setAuthConfig(plugin_dir_path( __FILE__ ).'/config/MY_API_KEY.json');
// Setting Scope
$client->addScope("https://www.googleapis.com/auth/indexing");
// Use batch
$client->setUseBatch(true);
$batch = new Google_Http_Batch($client,false,'https://indexing.googleapis.com');
// example url
$arr_url = array(
"https://example.com/job_option/job_op-title-job/",
"https://example.com/job_option/job_op-44/",
"https://example.com/job_option/job_op-title-job/job_op-31/",
);
foreach ($arr_url as $url) {
$postBody = new Google_Service_Indexing_UrlNotification();
$postBody->setType('URL_UPDATED');//regist.update
$postBody->setUrl($url);
$service = new Google_Service_Indexing($client);
$request = $service->urlNotifications->publish($postBody);
$batch->add($request);
}
$results = $batch->execute();
При вызове API выдается ответ "404 - Not Found". Это ответ var_dump
array (size=1)
'response-155592893' =>
object(Google_Service_Exception)[833]
protected 'errors' => null
protected 'message' => string 'Not Found' (length=9)
private 'string' (Exception) => string '' (length=0)
protected 'code' => int 404
protected 'file' => string '/var/www/html/wp-content/plugins/google-indexing-api-tool/vendor/google/apiclient/src/Google/Http/REST.php' (length=106)
protected 'line' => int 118
private 'trace' (Exception) =>
array (size=8)
0 =>
array (size=6)
...
1 =>
array (size=6)
...
2 =>
array (size=6)
...
3 =>
array (size=6)
...
4 =>
array (size=6)
...
5 =>
array (size=6)
...
6 =>
array (size=6)
...
7 =>
array (size=4)
...
private 'previous' (Exception) => null
public 'xdebug_message' => string '<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Google_Service_Exception: Not Found in /var/www/html/wp-content/plugins/google-indexing-api-tool/vendor/google/apiclient/src/Google/Http/REST.php on line <i>118</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'... (length=3607)
Я правильно создал учетную запись службы, но не могу повторить успех. Есть идеи, что на самом деле означает эта ошибка?
Заранее спасибо.