PHP multiple events sending
The method you would be using is events.insert this method Creates an event
as in singular there is no way to send a request that would send more than one.
You could use batching but all batching really is is sending X number of event.inserts in a single batch request. Its not going to save you on quota the quota cost will be the same the only thing it will save you on is on the number of HTTP calls you are making.
Global HTTP Batch Endpoints (www.googleapis.com/batch) will cease to work on August 12, 2020 as announced on the Google Developers blog. For instructions on transitioning services to use API-specific HTTP Batch Endpoints (www.googleapis.com/batch/api/version), refer to the blog post.
The above statment does not mean that batching doesnt work. It just means that the old batching endpoint which worled for every API no longer works now you need to send batching requests to each api
- www.googleapis.com/batch/drive/v3
- www.googleapis.com/batch/calendar/v3
you used to be able to send all batching requests no matter what api you were working with to
- www.googleapis.com/batch
That no longer works.
How to send batch request with Google Indexing API
I tried with PHP and completed.
//init google client
$client = new Google_Client();
$client->setAuthConfig('your_path_to_key.json');
$client->addScope('https://www.googleapis.com/auth/indexing');
$client->setUseBatch(true);
//init google batch and set root URL
$batch = new Google_Http_Batch($client,false,'https://indexing.googleapis.com');
//init service Notification to sent request
$postBody = new Google_Service_Indexing_UrlNotification();
$postBody->setType('URL_UPDATED');
$postBody->setUrl('https://your_job_detail');
//init service Indexing ( like updateJobPosting )
$service = new Google_Service_Indexing($client);
//create request
//$service->urlNotifications->createRequestUri('https://indexing.googleapis.com/batch');
$request_kame = $service->urlNotifications->publish($postBody);
//add request to batch
$batch ->add($request_kame);
Related Topics
Get Last Word from Url After a Slash in PHP
Clear Data in MySQL Table with PHP
PHP Get Height and Width in PDF File Proprieties
How to Send Https Posts Using PHP
Find a Percentage Value in a String Using Preg_Match
What Is the Use of Strict in Laravel Config/Database
Laravel 5.3 - HTMLspecialchars() Expects Parameter 1 to Be String
PHP Domdocument - Get HTML Source of Body
PHP Making a Download Counter Without Leaving the Current Page
Php: How to Check If the Client Is Local
Shell_Exec() Timeout Management & Exec()
Pdo's Rowcount() Not Working on PHP 5.2.6+
Error 1366 (Hy000): Incorrect String Value: '\Xf0\X9F\X98\X9C' for Column 'Comment' at Row 1
Why Does 'Intval(19.9 * 100)' Equal '1989'
How to Start Local Server with Symfony 5 or Downgrade Version to 4.4
In Flutter Web Getting 'Xmlhttprequest' Error While Making Http Call
How to Get the Total Found Rows Without Considering the Limit in Pdo