Search
 
SCRIPT & CODE EXAMPLE
 

PHP

google calendar api push notifications php

$channel = new Google_Service_Calendar_Channel($client);
$channel->setId('00000000-0000-0000-0000-000000000001');
$channel->setType('web_hook');
$channel->setAddress('https://www.yourserver.com/handleWatch.php');
$watchEvent = $service->events->watch(yourCalendarId, $channel, array());
Comment

google calendar api push notifications php

$url = sprintf("https://www.googleapis.com/calendar/v3/calendars/%s/events/watch", $calendar);

/* setup the POST parameters */
$fields = json_encode(array(
    'id'        => "some_unique_key",
    'type'      => "web_hook",
    'address'   => sprintf("http://%s//event_status/update_google_events", $_SERVER['SERVER_NAME'])
    ));

/* setup POST headers */
$headers[] = 'Content-Type: application/json';
$headers[] = 'Authorization: Bearer ' . $access_token;

/* send POST request */
$channel = curl_init();
curl_setopt($channel, CURLOPT_HTTPHEADER, $headers);
curl_setopt($channel, CURLOPT_URL, $url);
curl_setopt($channel, CURLOPT_RETURNTRANSFER, true);
curl_setopt($channel, CURLOPT_POST, true);
curl_setopt($channel, CURLOPT_POSTFIELDS, $fields);
curl_setopt($channel, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($channel, CURLOPT_TIMEOUT, 3);
$response = curl_exec($channel);
curl_close($channel);

error_log($response);
Comment

PREVIOUS NEXT
Code Example
Php :: Detecting specifically the My account "Dashboard" page 
Php :: laravel error reporting code for view 
Php :: subdomain ajax request fail in php 
Php :: auto complete order paid 
Php :: setUp() must be compatible with IlluminateFoundationTestingTestCase::setUp() 
Php :: formidable forms formsLimit logged-in users to two entries per day 
Php :: laravel join query taking too long 
Php :: phoenix query builder 
Php :: PHP str_rot13 — Perform the rot13 transform on a string 
Php :: return multiple rows from mysqli php and encode JSON 
Php :: merge two entity symfony 
Php :: woo can not change products perpage in shop page 
Php :: woocommerce subscriptions custom user rolde 
Php :: syntax error, unexpected variable "$result" in D:wordpressxampphtdocs empleteuser_delete.php on line 13 
Php :: sync fetch eloquent laravel 
Php :: laravel windows stop serving 
Php :: drupal 9 custom local stream wrapper 
Php :: php doctrine findby greater than 
Php :: laravel retry failed transactions 
Php :: php recapcha 
Php :: how to refresh a php variable without reloading page 
Php :: vscode php debugger change value 
Php :: Add Recent Posts by Category Using PHP 
Php :: caculator 
Php :: php edit user profile 
Php :: codecept run single test 
Php :: best web server for php 
Php :: send email accent subject php 
Php :: mkdir recursive php 
Php :: laravel gigapay list invoice 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =